I was watching a tutorial for using the JQuery toggle, and I want to use it on my site, But the thing is I want to div to be hidden initially on page load so, When somebody visit the page It is only a button saying some text to show the content, and when that button is clicked, then toggle and show the content, But as I am new I don’t know how to stop its default opened state:
function random_script(element,speed){
$(element).toggle(speed);
}
<input type="button" value"Show Results?" onClick="random_script('#somediv',1000);"/>
<div id="somediv"></div>
So is there any solution for this?
Alternative with JQuery (jsfiddle):