jQuery makes it easy to show, hide or toggle the visibility of a DOM element with the hide(), show() or toggle() methods.

It’s often useful to test if an element has been hidden or shown using jQuery. You can easily do this using the is() method to check if an element has a :visible or :hidden state.

// Checks for display:[none|block], ignores visible:[true|false]
$(element).is(":visible")

Working Demo

Here’ how it looks in context.

About the Author

Kevin Leary is a web developer in Boston, MA specializing in enterprise website design and development, online marketing, and conversion optimization.