I have added a transparent div on a window(with treeview) as follows in a function :
function add()
{
$dialog.html('<div id="div1" style="background: url(img/trans.png); opacity:0.1; filter:alpha(opacity=10); "></div>');
}
How do I remove this div so that I can see the contents of the window again in another function.
It’ll remove the
divwhich id’s#div1from the$dialog.If you use
$dialog.html()you’ll overwrite the html content, so try to useappendif you want to get it back.Look this demo.
References:
jQuery.remove(): http://api.jquery.com/remove/
jQuery.append(): http://api.jquery.com/append/