Hide divs on page load with supplied javascript expand/collapse tag

I am using the below expand/collapse div tag i found online.  It works great.  I just want to know how to make the div hidden onload, then when the user clicks the link it appears.

Thanks.
<SCRIPT LANGUAGE="JavaScript">
 
function switchMenu(obj) {
var el = document.getElementById(obj);
if ( el.style.display != 'none' ) {
el.style.display = 'none';
}
else {
el.style.display = '';
}
}
</SCRIPT>
 
<a onclick="switchMenu('myvar');" title="Switch the Menu">Switch it now</a>
 
<div id="myvar">
	<p>This is paragraph text that is all up in this place that does some pretty cool stuff</p>
	<p>This is paragraph text that is all up in this place that does some pretty cool stuff</p>
	<p>This is paragraph text that is all up in this place that does some pretty cool stuff</p>
	<p>This is paragraph text that is all up in this place that does some pretty cool stuff</p>
</div>

Open in new window

tags266Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

silemoneCommented:
inside div tag just place style = "display:none"

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
silemoneCommented:
<div id="myvar" style ="display:none">  it will toggle when javascript calls it even though it hardcoded...it will just be the initial state...

silemoneCommented:
In fact, this is the way it should be written...the  norm
tags266Author Commented:
Thanks that works perfectly!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.