jQuery [attribute|=value] 选择器

jQuery 教程 · 2019-03-10 15:57:19

实例

选取所有带有以 "Tomorrow" 开头的 title 属性的 <p> 元素:

$("p[title|='Tomorrow']")

定义和用法

[attribute|=value] 选择器选取每个带有指定属性的元素,该元素的值等于指定字符串(比如 "en")或以该字符串后跟连接符作为开头的字符串(比如 "en-us")。

提示:该选择器经常用于处理 language 属性。

语法

$("[attribute|='value']")

参数 描述
attribute 必需。规定要查找的属性。
value 必需。规定属性值需以此开头的字符串。

点击查看所有 jQuery 教程 文章: https://codercto.com/courses/l/35.html

查看所有标签

Practical Vim, Second Edition

Practical Vim, Second Edition

Drew Neil / The Pragmatic Bookshelf / 2015-10-31 / USD 29.00

Vim is a fast and efficient text editor that will make you a faster and more efficient developer. It’s available on almost every OS, and if you master the techniques in this book, you’ll never need an......一起来看看 《Practical Vim, Second Edition》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具