Forum Moderators: open

Message Too Old, No Replies

Running scripts

         

jack2501

7:01 am on May 4, 2008 (gmt 0)

10+ Year Member



Hi,

I'm trying to change the display property of some divs (named "courseDesc2", "courseDesc2",etc) using javascript.

Can you please tell me if this is right?

<script type="text/javascript" onload="hideAll()">

function hideAll(){

document.getElementById(courseDesc1).style.display = "none";

document.getElementById(courseDesc2).style.display = "none";

document.getElementById(courseDesc3).style.display = "none";

document.getElementById(courseDesc4).style.display = "none";

} 

</script>

Thanks for your help!

jack2501

7:11 am on May 4, 2008 (gmt 0)

10+ Year Member



Nevermind, i solved it!

just needed to fix my inverted commas. And i used <body onload="hideAll()"> instead of script.

Wish it was faster, though i guess the script can't run until the divs load.

Cheers