Show HTML in warning window just like iframe?

I want to show HTML in the warning window just like iframe ..? I can do it...

<script> alert("<html><body><h1>this is alert heading</h1></html></body>") </script> 

How can i do this??

+4
source share
3 answers

Instead of using alert, I would use Pop Up. And I recommend you use something like jQuery Dialog, see http://jqueryui.com/demos/dialog/

+4
source

You cannot do this through alert() .

You can simulate it using a modal dialog. There are many modal dialog libraries - jQuery UI is quite powerful.

+4
source

If you are asking how to display HTML markup as such in a warning window, do it:

 alert("\<html\>\<body\>\<h1\>this is alert heading\</h1\>\</html\>\</body\>") 

If you ask how to format the warning window using HTML, you cannot. You need to create a modal dialog box, as one of the other answers shows.

+4
source

Source: https://habr.com/ru/post/1413581/


All Articles