TUTORIALFrontendFETCHED

jQuery [attribute$=value] 选择器

jQuery [attribute$=value] 选择器 jQuery 选择器 实例 选取所有带有以 '.org' 结尾的 href 属性的 <a> 元素: $('a[href$='.org']') 尝试一下 » 定义和用法 [attribute$=value] 选择器选取每个带有指定属性且以指定字符串结尾的元素。..

Updated 7/16/2026

Tutorial detail pages default to noindex.

jQuery [attribute$=value] 选择器

jQuery 选择器 jQuery 选择器

实例

选取所有带有以 ".org" 结尾的 href 属性的 <a> 元素:

$("a[href$='.org']")

尝试一下 »

定义和用法

[attribute$=value] 选择器选取每个带有指定属性且以指定字符串结尾的元素。


语法

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

参数 描述
attribute 必需。规定要查找的属性。
value 必需。规定属性值以其结尾的字符串。


jQuery 选择器 jQuery 选择器