Jquery Dialog Destroy Example - Jquery

How to destroy dialog in jquery?

Snippet Code

Rate this page :
  [ 0 votes]

This jquery code destroys the dialog box and removes the div which hosts the dialog completely from page. The jquery dialog destroy code is given below.

<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src='http://code.jquery.com/jquery-1.10.2.js'></script> <script src='http://code.jquery.com/ui/1.11.4/jquery-ui.js'></script> <script> $(function() { $("#open").click(function(){ $('#dialog') .dialog( { autoOpen: true, title: 'Demo Dialog', close: function(event, ui) { $(this).dialog('destroy').remove() } }); }); }); </script> <div id="dialog" title="Demo dialog"> </div> <p id='open'>Click</p>


Ask Questions

Ask Question