jQuery Hide and Show


jQuery Hide and Show method is used to hide and show the html elements.


jQuery Hide and Show Syntax :

$(selector).hide(speed,selector);
$(selector).show(speed,selector);

jQuery Hide and Show Example 1:

hide() : Hides the html elements.
show() : Displays the html elements.

Example


<script type="text/javascript">
         $(document).ready(function(){
          $("#hidebutton").click(function(){
           $(".demo-para").hide();   
          });
          $("#showbutton").click(function(){
           $(".demo-para").show();   
          });
          });
</script>    

Try it »

jQuery Hide and Show Example 2:

Example


<script type="text/javascript">
         $(document).ready(function(){
          $("#hidebutton").click(function(){
           $(".demo-para").hide(500);   
          });
          $("#showbutton").click(function(){
           $(".demo-para").show(500);   
          });
          });
</script>    

Try it »


Add Comment

📖 Read More


Advertisements