if you were interested in removing #desktop, then you would need to use:
$("#desktop").remove();
in that statement, $("#desktop") first returns a reference to the DOM object that represents #desktop, and once the reference it returned, the remove() method is executed. In your case, the variable "element" already has a reference to the node you wish to remove, so all you need is:
element.remove();
Main Topics
Browse All Topics





by: zivperryPosted on 2008-10-04 at 13:26:51ID: 22642173
jQuery.remove() method, removes the object it refer to.
So, to remove the element you need to use it this way:
Select allOpen in new window