Jquery Example div Hide Show - Jquery

How to hide and show div content using jquery?

Snippet Code

Rate this page :
  [ 0 votes]

Sample jquery code allows to add hide and show effect to your div content. Here hide() method is used to hide the content, and show() method is used to display the hidden content. The jquery code to add hide/show effect is given below.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script> $(document).ready(function(){ $("#hide").click(function(){ $("div").hide(); }); $("#show").click(function(){ $("div").show(); }); }); </script> <div style='width:500px;border:1px solid grey;'>We welcome you to Hscripts.com. Praised as the best free webmaster resources online, by our users. If you are designing a website, then you can find all the resources you need for webmasters and web developers such as free scripts, web tools, programming tutorials, web design and applications, clipart images, web icons etc.</div> <input type='button' value='Hide' id="hide"> <input type='button' value='Show' id="show">


Ask Questions

Ask Question