编程学问
  • 文章
  • 问题
  • 读书
  • 关于
  • 登录
jQuery API 开发手册

返回值:Array<Element(s)>:contains(text)

概述

匹配包含给定文本的元素

参数

textStringV1.1.4

一个用以查找的字符串

示例

描述:

查找所有包含 "John" 的 div 元素

HTML 代码:
<div>John Resig</div>
<div>George Martin</div>
<div>Malcom John Sinclair</div>
<div>J. Ohn
jQuery 代码:
$("div:contains('John')")
结果:
[ <div>John Resig</div>, <div>Malcom John Sinclair</div> ]
相关文章
jquery easyui datagrid单元格鼠标移动弹出提示框tooltip的使用方法jquery easyui datetimespinner 日期时间微调框 jquery easyui searchbox 搜索框 jquery easyui numberbox 数值输入框 jquery easyui datagrid view 数据表格展示 animate params duration easing callback jquery button jquery contains text jqueryjquery.contains container contained jquerytext val|fn jquery text jqueryjquery contains text jquery $.contains c c jquery text val|fn jquery textphp domtext returns whether this text node contains whitespace in element contentphp domtext indicates whether this text node contains whitespacephp vector determines if the vector contains given valuesphp sam 函数 contains the text description of the last failed sam operationphp spoofchecker checks if a given text contains any suspicious characters
关注编程学问公众号
编程学问网 湘ICP备20001732号