javascript: DOM syntax for SPANS/DIVS ???

by "Phil Babcock" <pbabcock(at)bgsgroup.com>

 Date:  Wed, 24 Jan 2001 11:01:29 -0500
 To:  hwg-languages(at)hwg.org
  todo: View Thread, Original
HI all

I am trying to write a function that will allow me to hide/show different=
 spans ( 4 in total ) based on parameters passed to a function; like so:  

onclick=3D""showspan(1); return false""
onclick=3D""showspan(2); return false"" etc. etc. etc.


So my question is:  what is the correct DOM syntax for referencing=
 SPANS/DIVS, if it is even possible? (I could use < .div> 's instead of <=
 .span>'s if necessary.)  I need it work in IE4+ and NN4+.  However, I do=
 not need browser check code in this script, it is taken care of elsewhere.=
  I only need the correct DOM syntax for each browser and then I will use=
 ASP to write out the correct JavaScript to match whatever browser is being=
 used.

Something like

document.spans[1].style.visibility =3D 'hidden'  or


would be nice, but it doesn't work like this it seems.   What am I missing?

tia!
phil.

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.