How To Fully Destroy jQuery UI Dialog Boxes

Author: , July 11th, 2011

I was having issues with jQuery UI dialogs being hidden and not fully removed. Had same issues with both native dialog and the dialogwrapper plugin. The following code would hide, but not fully remove the div, for whatever reason:

So this is what I used instead:

!! UPDATE: After being coached by the […]

How To Remove An HTML Element By ID Using jQuery

Author: , April 12th, 2011

To remove the element with id equal to removeme: jQuery(“#removeme”).remove(); To remove the element with id equal to removeme only if it is empty: jQuery(“#removeme:empty”).remove(); To remove all empty DIVs: jQuery(“div:empty”).remove(); If it’s not empty, but has whitespace: if(jQuery.trim(jQuery(“#removeme”).text()) == “”) { jQuery(“#removeme”).remove(); } Original Post: http://stackoverflow.com/questions/527246/use-jquery-to-remove-a-div-with-no-children