JQuery check element is visible or not

3

How to check html element is visible/display or hidden using JQuery.This is very easy job.JQuery is() function can be easily use to this.Look at these examples.Those are perfectly working and responding all browsers.

This is the element.

Here,check that is visible or not.

Also you can use this to check visible or not that element.

This is the another mothod.

You can use opposite method to check element is visible or hidden.You can use “hidden” attribute to this.

May be if( $('#myDiv').is(':visible') ) is not working properly.So you can try to following method.

Note: All of these are return true or false.

Share.

About Author

Sumith Harshan is the Web Engineer Specializes in Java Script, JQuery, HTML4/5, CSS2/3, PHP, CodeIgniter, CakePHP, J2SE, J2EE, XML, Hacking & Security, Mobile Interface Developing, Magento, Wordpress, Joomla, Drupal,PHPBB,Facebook App Developing and Open cart...etc.

  • dinesh

    is(‘:visible’) is working fine.thnkx

  • Mull1

    if( $(‘#myDiv’).is(‘:visible’) ) is not working.if( $(‘#myDiv’).css(‘display’) == ‘none’ )is working.!
     

    • Thanks.Try to use this ,
      if( $(‘#myDiv:visible’) ) { // visible}