Tutorials References Exercises Bootcamps Videos Menu
Sign Up Create Website Get Certified Upgrade

jQuery :contains() Selector

❮ jQuery Selectors


Select all <p> elements containing "is":

Try it Yourself »

Definition and Usage

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

The string can be contained directly in the element as text, or in a child element.

This is mostly used together with another selector to select the elements containing the text in a group (like in the example above).

Note: The text is case sensitive.



Parameter Description
text Required. Specifies the text to find

❮ jQuery Selectors