DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Javascript - Dom Method For Removing Nodes
You can remove existing nodes as well as add new ones. 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 elements within the node being removed will be removed along with it.
<script type="text/javascript">
function removeBElm(){
var para = document.getElementById("example2");
var boldElm = document.getElementById("example2B");
var removed = para.removeChild(boldElm);
}
</script>
<p id="example2"><a href="#" onclick="removeBElm(); return false;">Click this link</a> to see the above script in action.</p>






Comments
Nitin Khare replied on Sun, 2013/03/24 - 12:10pm
I have found very useful information over there, thanks for sharing this. please try to add more informative posts in order to keep us in touch.
Nitin Khare replied on Sun, 2013/03/17 - 12:30am
the morning too before the sun got too hot. They did as we ask without too much complaining. Now they know all the different vegetables in the garden by sight. Good job kids.
Alicia Expart replied on Wed, 2012/11/07 - 8:07am
I always like your blog post because you always comes with different ideas and information. I always shared your site post with my friends. Keep posting and i will follow you..
Rao Yasir replied on Sun, 2012/10/14 - 3:30am
Backlink Expart replied on Thu, 2012/09/20 - 6:27pm
Snippets Manager replied on Mon, 2012/04/02 - 11:37pm