Jquery Content and Visibility Filters

Jquery Content and Visibility Filters

Content and Visibility filters examine the content of the elements that are returned by the selector expression or their visibility property to determine if they should be included or excluded from the result set.

There are four content filters

Content Filter Purpose
:contains(text) Filters the selection to only include elements that contain the text string
:empty Filters the selection to only include empty elements
:has(selector) Matches elements that contain at least one element that has the specified selector
:parent Matches all elements taht are parents

Here are a few examples of how you may use content filters

There are also two filters

Visibility Filter Purpose
:visible Filters the selection to only include visible elements
:hidden Filters the selection to only include hidden elements

 

comments powered by Disqus