How to use hide() method on button click using jQuery ?
jQuery has a lot of handy methods to get the work done easily. In this article, we will discuss one of them which is the hide() method. We can use this method for various purposes on our webpage and get an efficient result.
The very first step will be creating an HTML file and link the jQuery library file via CDN.
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML course.
jQuery CDN Link:
<script src=”https://code.jquery.com/jquery-3.6.0.min.js” integrity=”sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=” crossorigin=”anonymous”></script>
jQuery hide() method: This method is used for hiding the web elements.
Example 1: Create an HTML file and add the following code to it.
Example 2: We can use the hide() method to hide an image.
Example 3: The hide() method can also be used to hide any geometrical shape.