Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] getElementsByTagName("*") to get all elements
- From: paul at novitskisoftware.com (Paul Novitski)
- Subject: [Javascript] getElementsByTagName("*") to get all elements
- Date: Tue Jul 26 02:10:19 2005
Friends,
I want to use getElementsByTagName("*") -- with an asterisk in place of a
tagName -- to return an array of all elements on the page regardless of
their 'generation' or 'nest depth' -- as contrasted with childNodes() which
returns only first-generation children of the parent.
Here's a quickie test script that demonstrates both methods:
http://novitskisoftware.com/demos/gettingAllElements/
The getElementsByTagName("*") method works fine in the latest-version
Windows browsers I've tested it in (Mozilla & IE).
Does anyone know of a browser that supports getElementsByTagName() but
DOESN'T support the use of an asterisk in place of a literal tag name?
Thanks,
Paul
- Follow-Ups:
- [Javascript] getElementsByTagName("*") to get all elements
- From: Peter-Paul Koch
- [Javascript] getElementsByTagName("*") to get all elements
- Prev by Date: [Javascript] Measuring time to load page
- Next by Date: [Javascript] getElementsByTagName("*") to get all elements
- Previous by thread: [Javascript] Measuring time to load page
- Next by thread: [Javascript] getElementsByTagName("*") to get all elements
- Index(es):