Set jquery toggle function default is hide
How to set the Jquery toggle function is hide in default? This is quite easy, there are few method: First is adding the style display:none on the element like: <p style="display:none;"> Second method is using the Jquery hide() function: all you need to do is to add the $("#details").hide(); in front of the click function $(document).ready(function(){ $("#details").hide(); $("#clickin").click(function(){ $("#details").toggle(); }); }); so the element that have the id called details will hide in the beginning. Hope help! =D