jQuery hide() and show()
With jQuery, you can hide and show HTML elements with the hide() and show() methods:Example
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("#hide").click(function(){
$("p").hide();
});
$("#show").click(function(){
$("p").show();
});
});
</script>
</head>
<body>
<p>If you click on the "Hide" button, I will disappear.</p>
<button id="hide">Hide</button>
<button id="show">Show</button>
</body>
</html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("#hide").click(function(){
$("p").hide();
});
$("#show").click(function(){
$("p").show();
});
});
</script>
</head>
<body>
<p>If you click on the "Hide" button, I will disappear.</p>
<button id="hide">Hide</button>
<button id="show">Show</button>
</body>
</html>
Syntax:
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("p").toggle();
});
});
</script>
</head>
<body>
<button>Toggle</button>
<p>This is a paragraph with little content.</p>
<p>This is another small paragraph.</p>
</body>
</html>
$(selector).hide(speed,callback);
$(selector).show(speed,callback);
$(selector).show(speed,callback);
Other Example
<!DOCTYPE html><html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("p").toggle();
});
});
</script>
</head>
<body>
<button>Toggle</button>
<p>This is a paragraph with little content.</p>
<p>This is another small paragraph.</p>
</body>
</html>




![jQuery - unbind( [type], [fn] ) Method jQuery - unbind( [type], [fn] ) Method](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3D1qokr9vvAl30ch5jCwh7uv0pD-iBNyRvRw8sUlAc9n4jFJgWAkB4By1x7O93HrcYOR3snmoWhxAL1peRQUm1BBz9Eez86ayKWzf1jXYoKTiFmlwVRzQF4a_RFHr5kdbPGA3quto7Xo/s72-c/images.jpeg)
No comments: