Solved

removeChild at perticular Index

Posted on 2009-04-02
1
315 Views
Last Modified: 2012-05-06
hi guys having problem -  

please help urgen,

ok so i have code below - which works for foo.removeChild(foo.lastChild);

but how do i remove individual child from the parent,

i tried below method but does not work yet

Please help
	function remove(){
		var foo = document.getElementById("fooBar");
		var buttonID = document.getElementById("button0");
		//alert(buttonID);
		foo.removeChild(foo.buttonID);
		//foo.removeChild(foo.lastChild);
		}
 

Open in new window

0
Comment
Question by:montu_12
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 9

Accepted Solution

by:
Graceful_Penguin earned 500 total points
ID: 24058045
I gave two methods to get the node to remove use the one that works best for you.
function remove()
{
	//var foo = document.getElementById("fooBar");
	//var buttonID = document.getElementById("button0");
	//foo.removeChild(buttonID);
	fooBar.removeChild(button0);
}

Open in new window

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Digital services have impacted the providers of three major areas: revenue generation, enhanced customer experience, and cost optimization. An increase in revenue generation through the use of modern upsells whilst giving digital services to the cus…
By reading this blog, MSPs will gain insight into how to improve communications with their clients as well as establish a more profitable business.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question