show HTML in alert window same like iframe?
html, javascript
Solution
Instead of using alert, I would use a Pop Up. And I recommend you to use something like jQuery Dialog , look at http://jqueryui.com/demos/dialog/
Sample :
First, create a div to wrap your html elements,
<div id='my-dialog-id' title='my dialog title'>
<h1>this is alert heading</h1>
</div>
Then include some javascript with jQuery and jQueryUI
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$(function() {
$("#my-dialog-id").dialog(); //Here I select a div with id my-dialog-id and start the plugin.
} );
</script>
And it's ready!
Problem
i want to show HTML in alert window same like iframe..? can i do this... ``` <script> alert("<html><body><h1>this is alert heading</h1></html></body>") </script> ``` how can i do this..?