Jarvis Jarvis - 1 month ago 12
Javascript Question

Alternative to getElementsByTagName

Since the getElementsByTagName() function is new (DOM-1?) I wanted another more reliable method to get a reference to an element based on its tag name/id.

Edit- Without using a framework, since I need to cut down on size; so 10-20K for a framework is unacceptable. I just need the JS code that can fetch an element

Answer

getElementsByTagName is not new. It is supported since IE5, FF1 and Opera 7 according to w3schools

[edit] Thanks for pointing this out. It was indeed supported since Opera 7.

Comments