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

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

java - Using an Integer ArrayList in Android -