Full version: jsB@nk » Snippet » Removing Nodes Using the DOM
URL: https://www.javascriptbank.com/removing-nodes-using-the-dom.html
You can remove existing nodes using the DOM. The removeChild
method allows any node to remove one of its child nodes. Simply pass a reference to the node you wish to remove. Any text or innerHTML elements within the node being removed will be removed along with it.
Full version: jsB@nk » Snippet » Removing Nodes Using the DOM
URL: https://www.javascriptbank.com/removing-nodes-using-the-dom.html
<script type="text/javascript">// Created by: Brad | http://snippets.dzone.com/posts/show/2598function removeBElm(){ var para = document.getElementById("example"); var boldElm = document.getElementById("example2"); var removed = para.removeChild(boldElm);}</script><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<fieldset style="width: 340px;"><legend>Remove a section</legend><div id="example"><p>Ma quande lingues coalesce, li grammatica del resultant lingue.</p><p id="example2">Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p></div></fieldset><p id="example2"><a href="#" onclick="removeBElm(); return false;">Click this link</a> to remove the section above.</p><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->