Do you want to remove an item <div>from your document?
First things first; find out the DOM!
var aReferenceToMyDiv = document.getElementById('foo');
aReferenceToMyDiv.parentNode.removeChild(aReferenceToMyDiv);
... will remove the element <div>when applied to the following DOM structure:
<div id="foo">
<span>...</span>
other stuff...
</div>
James source
share