Jquery Click Toggle Example - Jquery

How to do toggles between hide() and show() for the selected elements using Jquery?

Snippet Code


  
Rate this page :
  [ 0 votes]

By using toggle click you can show and hide your content. This jquery code toggles the element when toggle button clicked. Here toggle() function is used to hide and show the content.

<script type='text/javascript'> $(document).ready(function(){ $("#btntoggle").click(function(){ $("#content").toggle(); }); }); </script> <div align='center'> <div id='content'>This effect toggles between hide() and show() for the selected elements using Jquery.</div> <input type='button' id='btntoggle' value='Toggle'> </div>

Tags


Ask Questions

Ask Question