Jquery Toggle Effect - Jquery

How to produce show and hide effect using jquery toggle()?

Snippet Code

Rate this page :
  [ 0 votes]

You can toggle between hide() and show() for the selected elements using Jquery. Here,

tag content is toggled (Shown content are hidden and hidden content are shown) on the button click.

<script type='text/javascript'> $(document).ready(function(){ $("#btn").click(function(){ $("p").toggle(); }); }); </script> <div align='center'> <p>Welcome to Hscripts.com.</p> <input type='button' id='btn' value='Show / Hide'> </div>


Ask Questions

Ask Question