Selecting Elements Based on Visibility

$("div:visible");   //selects <div> elements that are currently visible $("div:hidden");   //selects <div> elements that are currently hidden

If you are using visibility to control the flow and interactions of your web page components then using the visibility jQuery selectors makes it simple to select the HTML elements that are hidden or visible. Table 4.6 shows some examples of visibility selectors.

Image

Table 4.6 Examples of Using Attribute jQuery Selectors

Get jQuery and JavaScript Phrasebook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.