You can show and hide HTML elements using the jQuery show() and hide() methods.The show() method shows the hidden, selected elements.the show() works on elements hidden with jQuery methods and display:none
Syntax:
$(selector).show(speed,easing,callback)
|
Example :
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$(".butn1").click(function(){
$("p").hide();
});
$(".butn2").click(function(){
$("p").show();
});
});
</script>
</head>
<body>
<p>This is a paragraph.:- Hellow world ! How are you ?.</p>
<button class="butn1">Hide</button>
<button class="butn2">Show</button>
</body>
</html>
|