...

View Full Version : removing elements



niche
12-09-2011, 03:46 PM
I put this at the end of my code thinking that after the div displays (id = 'link_container') I can eliminate (id = 'link_container') from memory when the script ends so there's a place for another div (id = 'link_container') when/if there's onkeyup event.

Wouldn't this little script remove any element with an id = 'link_container' ?

<script type="text/javascript">
var deleteDiv = document.getElementById('link_container');
document.body.removeChild(deleteDiv);
</script>

Logic Ali
12-09-2011, 05:07 PM
deleteDiv.parentNode.removeChild( deleteDiv );



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum