Solved

Alternative to document.getElementsByTagName

Posted on 2001-06-25
2
864 Views
Last Modified: 2012-08-14
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
Comment
Question by:x666xchange
2 Comments
 
LVL 22

Accepted Solution

by:
CJ_S earned 30 total points
Comment Utility
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
 
LVL 8

Expert Comment

by:bebonham
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now