How can I use jquery to remove a SPECIFIC div that has no children (at least no children that isn\'t whitespace). E.g.
some cont
To remove the element with id
equal to removeme
:
$("#removeme").remove();
To remove the element with id
equal to removeme
only if it is empty:
$("#removeme:empty").remove();
To remove all empty EDIT: If it's not empty, but has whitespace:$("div:empty").remove();
if($.trim($("#removeme").text()) == "") {
$("#removeme").remove();
}