Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

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