Easy Tutorial
❮ Html Toggleclass Misc Isxmldoc ❯

jQuery :contains() Selector

jQuery Selectors

Example

Select all <p> elements that contain the text "is":


Definition and Usage

The :contains() selector selects elements that contain the specified string.

The string can be directly contained within the element or within a child element.

The most common usage: used in combination with other selectors to select elements that contain specific text within a specified combination (as in the example above).

Note: The text is case-sensitive.


Syntax

Parameter Description
text Required. The text to search for.

jQuery Selectors

❮ Html Toggleclass Misc Isxmldoc ❯