jquery - toggle show/hide div with button? load state hidden -


i using jquery toggle hide/show div with:

html:

<div id="newpost">     test text </div>  <button>click</button> 

jquery:

$("button").click(function() {     $("#newpost").toggle(); }); 

(the above working perfectly)

from: http://jsfiddle.net/andrewwhitaker/kpfrb/

how can change state on page load hidden?

use style="display:none"

or hidden="true"


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -