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.

Meet the Author

Kevin Leary, Boston WordPress Developer of 10 Years

I'm a freelance web developer and WordPress consultant in Boston, MA with 13 years of experience building websites and applications. View a portfolio of my work or request an estimate for your next project.