Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY CYBERSECURITY DATA SCIENCE
     ❯   

jQuery :contains() Selector

❮ 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