How to Check Hidden Element If Exists Using jquery

In this tutorial, learn how to check hidden element and find if it exists using jQuery. The short answer is: use jQuery length with the item selector to display element on button click.

Find the hidden element existence and display the element on button click. Initially, the element is in the hidden state using the CSS display:none property. You may also like to read how to redirect to another page using jQuery and Javascript.

Check Hidden Element If Exists with jquery

To perform this task, you have to use the jQuery show/hide function to show the element when exist. You also have to use the click event of jQuery using the click function to perform a task on button click.

Test it Live


The above example contains the button which on click find the existence of an element. Click the above button to check hidden element if exists and display using show(). The example contains the div element and the paragraph element which is initially in a hidden state.

Hope, you like this tutorial of how to check hidden element and find if it exists using jQuery. If you have any query regarding the tutorial, please comment below.

Also tell me, which method you are using to find the hidden element using jQuery.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.