jquery USES the hide method to hide the element that specifies id
- 2020-05-19 04:12:39
- OfStack
This example shows that jquery USES the hide method to hide elements that specify id. Share with you for your reference. The details are as follows:
The following code hides the element id=test through the hide method of jQuery
<!DOCTYPE html>
<html>
<head>
<script src="js/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("#test").hide();
});
});
</script>
</head>
<body>
<h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p id="test">This is another paragraph.ofstack.com</p>
<button>Click me</button>
</body>
</html>
I hope this article is helpful to you in jQuery programming.