Solved

removeChild at perticular Index

Posted on 2009-04-02
1
311 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
time validation 6 325
Javascript question 9 63
Sorting tables using javascript 9 77
New Javascript features previously needing jquery 7 125
Cloud-based technologies and services will continue to grow in popularity in 2017 thanks to the simple, scalable and cost-effective solutions they deliver. Here are three areas where cloud adoption is poised to really take off.
An analysis of the phishing scam that has been affecting Google users, along with steps to take for protection, as well as what to do if you receive one of the emails.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

863 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now