|
Hi...
First, Tripy thank you for my other posting.
Now, I came across ANOTHER problem...
Here's the HTML of what I need to manipulate...
<div id="menu1">
<span class="dropdown">
<a href="#">Equities & Options</a><br />
<a href="#">Fixed Income</a><br />
<a href="#">Mutual Funds</a><br />
<a href="#">Managed Money</a><br />
<a href="#">Annuities</a><br />
<a href="#">Other Investments</a><br />
<a href="#" class="dropdown">Account Types</a><br />
</span>
</div>
I have to delete the ENTIRE line of the menu... the <a> and <br />
To do this, I'm pulling getElementsByTagName("span")...
var spanList = getElementsByTagName("span");
This spanList length is 1 because there's only one span.
My problem is accessing the child. If I hard code it (spanList[i].childNodes[x].nodeName - where x = a number in the array), I can access it.
But, how to do via a for loop.
hasChildNodes() does not work on getElementsByTagName, only on getElementsById.
if I do a spanList.hasChildNodes() - I get a JavaScript error saying the object doesn't support this.
I've scoured the web and books but unless if I pre-know the number of child elements in spanList, I can't access them.
Thanks
Donna
|