Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] looping through nodeList
- From: apwebdesign at yahoo.com (Anthony Ettinger)
- Subject: [Javascript] looping through nodeList
- Date: Tue Oct 18 13:39:34 2005
Can't seem to get this down, I get an HTML object, but
it's length is zero.
var anchors = document.getElementsByTagName("a");
alert(anchors); // yields [object HTML Collection]
for (anchor in anchors)
{
var item = anchor;
alert(item); //yields length, item, namedItem
(once)
}
at this point, I cannot figure out for the life of me
how to access an instance of the anchors list.
Basically, I just want to call getAttribute("href") on
it.
It seems as though anchors is not really a nodeList,
more like a list of metadata about the nodeList.
Thanks.
Anthony Ettinger
ph: (408) 656-2473
web: http://www.apwebdesign.com
- Follow-Ups:
- [Javascript] looping through nodeList
- From: Allard Schripsema
- [Javascript] looping through nodeList
- From: Roland Dong
- [Javascript] looping through nodeList
- From: Hassan Schroeder
- [Javascript] looping through nodeList
- From: Anthony Ettinger
- [Javascript] looping through nodeList
- Prev by Date: [Javascript] regex
- Next by Date: [Javascript] looping through nodeList
- Previous by thread: [Javascript] regex
- Next by thread: [Javascript] looping through nodeList
- Index(es):