Re: DOM1/ Netscape6 question

by "tim booker" <timbooker(at)btinternet.com>

 Date:  Thu, 8 Mar 2001 11:13:28 -0000
 To:  "Peter-Paul Koch" <gassinaumasis(at)hotmail.com>,
<anottingham(at)topazti.com>,
<hwg-techniques(at)hwg.org>
 References:  hotmail
  todo: View Thread, Original
If it's an array, it should look something like:

document.getElementByID(box[x]).style.visibility="visible"

If the element's ID is stored in a variable (in this case, an array), you
should not use quotes.

Tim


http://www.timbooker.com/



----- Original Message -----
From: "Peter-Paul Koch" <gassinaumasis(at)hotmail.com>
To: <anottingham(at)topazti.com>; <hwg-techniques(at)hwg.org>
Sent: Thursday, March 08, 2001 9:13 AM
Subject: Re: DOM1/ Netscape6 question




>I cannot figure out how to pass and element of an array to the getElementId
>method of document (which as far as I have been able to figure out, is what
>I should use for Netscape 6 and other browsers that support DOM1).
>
>I have tried:
>
>document.getElementByID('box[x]').style.visibility="visible"
>document.getElementByID('box').x.style.visibility="visible"
>and even building something like var menu="'box[" + x + "]'" and then
>document.getElementById(menu).style.visibility="visible"

Try

document.getElementById('box'+i).style.visibility='visible'

It should work, if I understand correctly that the elements have IDs "box1",
"box2" etc.

ppk

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

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