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]

Working Demo

Here’ how it looks in context.

About the Author

Kevin Leary is a freelance web developer in Boston, MA specializing in enterprise WordPress development, conversion optimization and JavaScript development.