:contains(text)
Finds
all elements which contain the given text.
$("div:contains('John')")
The
above code will find all the DIVs which contains the word 'John'. The argument
passed inside contains() is string type and case sensitive.
:empty
Matches
all elements that have no children (including text nodes).
$("td:empty")
This
code will find all the Tds which doesn't have any value or are empty.
:has(selector)
Matches
elements which contain at least one element that matches the specified
selector.
$("div:has(p)")
The
above code will match the DIV elements which have a paragraph (p
element) inside them. The attribute selector is a selector with which we
want to filter by.
:parent
This
finds all elements that are parents i.e. they have child elements, including
text.
$("td:parent")
Finds
all tds which have other child control, including text, inside them.