English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The :contains() selector selects all elements that contain the specified text.
The text can be directly contained within the element or within a child element.
$(":contains(text)")
Select each <p> element that contains "is":
$("document").ready(function(){ $("p:contains(is)").css("background", "coral"); });Test See‹/›
Parameter | Description |
---|---|
text | The text string to be searched. Case sensitive |