- The below code will help to identify if the element is visible or not:
$(element).is(":visible");
However, :visible
will also check if the parent elements are visible.
// Matches all element that are hidden $('element:hidden') // Matches all element that are visible $('element:visible')
- To check the display property of single element and not the parent element we have third alternative
if($(element).css('display')=='none'){ // element is hidden }