Skip to main content

Element Selector in Jquery

In this article we will learn about Element Selector

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

<h2>This is a heading</h2>



<button>Click to hide paragraphs</button>

</body>
</html>

Comments