JQuery Content Filters Visibility Filters

There are 6 different types of filters in JQuery to provide more control over selecting elements. Usage about content filters and visible filters will be discussed in this post.

These filters provide ability to examine the content of selected elements or their visibility property to determine whether they should be included or excluded from the final set.



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 that are parents (i.e they contain at least one other element, including text)
Visibility Filters Purpose
:visible Filters the section to only include visible elements
:hidden Filters the section to only include hidden elements

Examples can be found from this link

No comments:

Post a Comment