How To Remove An HTML Element By ID Using jQuery

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
Leave Your Comment
All fields marked with "*" are required.