jQuery USES the hide method to hide instances of the element's own usage

  • 2020-05-19 04:12:46
  • OfStack

This article is an example of how jQuery USES the hide method to hide the element itself. The details are as follows:

The JS code implementation below lets the button be clicked to hide itself


<!DOCTYPE html>
<html>
<head>
<script src="js/jquery.min.js">
</script>
<script>
$(document).ready(function(){
 $("button").click(function(){
  $(this).hide();
 });
});
</script>
</head>
<body>
<h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<button>Click me</button>
</body>
</html>

I hope this article has been helpful to your jQuery programming.


Related articles: