Code Snippet of Hide and Show in JQuery.

Amatya
Posted by Amatya under jQuery category on | Points: 40 | Views : 448
show() to show the elements in a wrapped set and hide() to hide them.
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#hideDNF").click(function(){
$("p").hide();
});
$("#showDNF").click(function(){
$("p").show();
});
});
</script>
</head>
<body>

<p>Bye DNF</p>

<button id="hideDNF">Hide Me</button>
<button id="showDNF">Show Me</button>

</body>
</html>


Thanks
Amatya

Comments or Responses

Login to post response