jQuery :contains() 选择器
jQuery 教程
· 2019-03-10 12:58:18
实例
选取所有包含 "is" 的 <p> 元素:
$("p:contains(is)")
定义和用法
:contains() 选择器选取包含指定字符串的元素。
该字符串可以是直接包含在元素中的文本,或者被包含于子元素中。
最常见的用法:与其他选择器一起使用,选取指定组合中包含指定文本的元素(如上面的实例)。
注意:文本是大小写敏感的。
语法
$(":contains(text)")
| 参数 | 描述 |
|---|---|
| text | 必需。规定要查找的文本。 |
点击查看所有 jQuery 教程 文章: https://codercto.com/courses/l/35.html
Never Lost Again
[美] Bill Kilday / HarperBusiness / 2018-5-29 / USD 8.00
As enlightening as The Facebook Effect, Elon Musk, and Chaos Monkeys—the compelling, behind-the-scenes story of the creation of one of the most essential applications ever devised, and the rag-tag tea......一起来看看 《Never Lost Again》 这本书的介绍吧!