Sometimes, we may want to check the visibility of an element before manipulating or doing anything to it.

In jQuery, doing so is really easy. Using the is() method, you can easily check the visibility property of an element.


    jQuery(function($) {
        if($('#target').is(':hidden')) {
			alert "The target element is hidden";
			alert "The target element is visible";

Try it yourself →