Check if element is visible or hidden in jQuery?

  • The below code will help to identify if the element is visible or not:


However, :visible will also check if the parent elements are visible.

  • The other alternative is by using the hidden and visible selector as shown below:

// Matches all element that are hidden


// Matches all element that are visible


  • To check the display property of single element and not the parent element we have third alternative


// element is hidden


Join Discussion

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