How do you check if an element is hidden in JavaScript?

Learn how to simplify your visibility search by nesting methods within CSS classes.

By Craig Buckler
November 10, 2016
Screenshot from "How do you check if an element is hidden in JavaScript?" Screenshot from "How do you check if an element is hidden in JavaScript?"

There are countless ways to hide an element and each requires a unique search method. The trick to simplifying this task is to make the hidden property simple to locate in the first place. In this video Craig Buckler recommends simplifying the potential search by nesting visibility methods within a CSS class. Novice JavaScript developers will learn best practices to prepare for future scenarios.

Continue learning about JavaScript in Safari with our Learning Paths.

Learn faster. Dig deeper. See farther.

Join the O'Reilly online learning platform. Get a free trial today and find answers on the fly, or master something new and useful.

Learn more

Craig Buckler is an experienced Web Developer working in the UK who started his career creating desktop software. Craig has worked for a number of well-known companies, including Microsoft, MSN, and Thomson Reuters, as well as the UK & EU governments. Craig is the prolific author of countless articles and tutorials on HTML5, CSS3, JavaScript, JQuery, PHP, and Node.js.

Post topics: Web Programming
Post tags: Questions
Share: