X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

jQuery :contains() Selector

jQuery Selectors jQuery Selectors

Example

Select all <p> elements containing "is":

$("p:contains(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.


Syntax

$(":contains(text)")

Parameter Description
text Required. Specifies the text to find


jQuery Selectors jQuery Selectors


Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook