Download File Simplyocde jQuery hide() and show()


Download1
Stock
File Size0.89 KB
Create DateNovember 11, 2016
Download

Step 1 : Create Buttons In html

<p class="para">If you click on the "Hide" button, I will Hide.</p>
<button id="hide">Hide</button><button id="show">Show</button>

Step 2 : Create CSS

container { width:70%; margin:0 auto;}
button {
	background:#936; color:#fff; padding:10px; border:0px; cursor:pointer;
	}
	
	button:hover { background:#333;}
.para { padding:15px; background:#ddd;}



Step 3 : Create Jquery using ID on button with jquery library


<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
(document).ready(function(){
    $("#hide").click(function(){
        $("p").hide(200);
    });
    $("#show").click(function(){
        $("p").show(200);
    });
});</script>

Leave a Reply

Your email address will not be published. Required fields are marked *