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.

Example

<script>
    jQuery(function($) {
        if($('#target').is(':hidden')) {
			alert "The target element is hidden";
		}else{
			alert "The target element is visible";
		}
    });
</script>

Try it yourself →