Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: pass a dynamically named div to a function


Message #1 by "Tony" <one_dev@h...> on Fri, 28 Sep 2001 11:03:48 -0500
Thanks so much Alex.

That worked great!

Tony


"Alex Shiell, ITS, EC, SE" <alex.shiell@s...> wrote in message
news:106036@j...
>
> you can get the element from the id with - guess what? - getElementById
>
> var oDiv = document.getElementById(sDivId);
>
> or for older browsers you can use the eval function
>
> var oDiv = eval("document."+sDivId);
>
> (eval still works in new browsers, but w3c recommends using
getElementById)
>
> -----Original Message-----
> From: Tony [mailto:one_dev@h...]
> Sent: 28 September 2001 17:04
> To: javascript
> Subject: [javascript] pass a dynamically named div to a function
>
>
> Is there any way to pass a dynamically named div to a function from
another
> object?
>
> For example:
>
> <input id='35' type='checkbox' onclick="clickMe('div' + this.id)">
> <div id='div35'></div>
>
> When the function receives the parameter, it sees a string, not a div
> object.  Therefore I cannot get to the properties...
>
> Any help would be appreciated,
>
> Tony

  Return to Index