Skip to main content

Jquery Hide and Show

In this article we will learn about Jquery Hide/Show:

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $("#hide").click(function(){
    $("p").hide();
  });
  $("#show").click(function(){
    $("p").show();
  });
});
</script>
</head>
<body>

<p>Hello</p>

<button id="hide">Hide</button>
<button id="show">Show</button>

</body>
</html>

Comments