jQuery Show and Hide Implementation

This is a simple post in which you will learn how to implement show and hide functions in jQuery. Basically in this post you will learn how to hide html elements using jQuery show and hide Methods.

Demo


jQuery HIDE & SHOW

The Code:
 
<script>
$(document).ready(function(){
  $("button#bDemo1").click(function(){
    $("div#divDemo").hide(1000)
  });
  $("button#bDemo2").click(function(){
    $("div#divDemo").show(1000)
  });
});
</script>
<style>
#bDemo1 #bDemo2{
 color: #fff !important;
 background-color: #2196F3 !important;
}
#divDemo{
 border:1px solid #555;
 border-radius:3px;
 color:white;
 background:#555;
 height:270px;
 width:400px;
 position:relative;
 font-size:5em;
}
</style>
<div id="divDemo">jQuery HIDE & SHOW</div></br>
<button id="bDemo1">Hide</button>
<button id="bDemo2">Show</button>

Got anything to say, do comment here !

Comments