Latest web development tutorials

jQuery [attribute$=value] 選擇器

jQuery 選擇器 jQuery選擇器

實例

選取所有帶有以".org" 結尾的href 屬性的<a> 元素:

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

嘗試一下»

定義和用法

[attribute$=value] 選擇器選取每個帶有指定屬性且以指定字符串結尾的元素。


語法

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

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


jQuery 選擇器 jQuery選擇器