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

返回值:Array<Element(s)>[attribute]

概述

匹配包含给定属性的元素。注意,在jQuery 1.3中,前导的@符号已经被废除!如果想要兼容最新版本,只需要简单去掉@符号即可。

参数

attributeStringV1.0

属性名

示例

描述:

查找所有含有 id 属性的 div 元素

HTML 代码:
<div>
  <p>Hello!</p>
</div>
<div id="test2"></div>
jQuery 代码:
$("div[id]")
结果:
[ <div id="test2"></div> ]
相关文章
jquery easyui datagrid单元格鼠标移动弹出提示框tooltip的使用方法jquery easyui datetimespinner 日期时间微调框 jquery easyui searchbox 搜索框 jquery easyui numberbox 数值输入框 attribute*=value jquery attribute=value jquery attribute jquery attribute!=value jquery attribute =value jqueryjquery attribute*=value jquery attribute=value jquery attribute jquery attribute!=value jquery attribute =value php collator get collation attribute valuephp domelement adds new attribute node to elementphp ncurses 函数 returns current soft label key attributephp radius 函数 attaches a vendor specific string attributephp hyperwave api 函数 removes attributephp sphinxclient set attribute name for per group distinct values count calculations
关注编程学问公众号
编程学问网 湘ICP备20001732号