[thelist] Accessing layers in Javascript

Craig Saila crsaila at yahoo.ca
Wed Jan 30 09:32:00 CST 2002


Mark Howells wrote:

> use the document.all array. Any idea what I can use in browsers that
> recognize document.getElementById, specifically NN6? document.all and
> document.layers aren't recognized in this browser.

  var the_divs = document.getElementsByTagName("DIV")

will give you a list of all the DIVs in the document. Alternately, if
you only want the DIVs with, say, the DIV with the ID of "content" try:

  var the_content = document.getElementById("content")
  var the_divs = the_content.getElementsByTagName("DIV")

--
Cheers,

Craig Saila
------------------------------------------
craig at saila.com  :  http://www.saila.com/
------------------------------------------


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




More information about the thelist mailing list