Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 954
  • Last Modified:

Alternative to document.getElementsByTagName

Is there an alternative to getElementsByTagName that works uniformly for browser versions 4 and uPwards upto version 6 for both IE and NETSCAPE.

Semms getElementsByTagName will work only for browser versions 5 and upwards
0
x666xchange
Asked:
x666xchange
1 Solution
 
CJ_SCommented:
there is no uniform way of accomplishing that.

in Netscape you can only do it for layers:
myarray = document.layers

in IE you can use:
document.all.tags("DIV")
or any other kind of tag

in IE 5 + and NS 6 you can use
document.getElementsByTagName("DIV")

regards,
CJ
0
 
bebonhamCommented:
I'm really trying to support that tag in the new sites I'm working on...

that and document.all

those are the two best ways of getting elements in my opinion, and although ns4 makes you jump through hoops to get some elements..I'm hoping that this trend towards a univeral way to access an element is going to develop to a standard ! yes!

anyways, if you are having a problem with getting at something in ns4, then let us try and help, otherwise, if you are just frustrated, welcome to the club.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now