Forum Moderators: open

Message Too Old, No Replies

performing a javascript function multiple times

performing a javascript function multiple times

         

FeralUK

7:03 pm on Jul 6, 2009 (gmt 0)

10+ Year Member



Hey,
I've got this javascript code

window.onload=function() { document.onclick=function() { hide('mydiv'); }; };

Does anybody know how I could modify this code so that I could perform the same function on another div? if I use this code on another div tag then it overwrites this code. I've tried changing it myself but had no luck.
Thanks.

PokeTech

10:38 pm on Jul 6, 2009 (gmt 0)

10+ Year Member



What about:

window.onload=function() { document.onclick=function() { hide('mydiv');hide('otherdiv'); }; };

does that work?

FeralUK

10:51 pm on Jul 6, 2009 (gmt 0)

10+ Year Member



Thanks. That works perfectly.