[ attribute $ = value ]选择器用于选择属性值以指定value结尾的元素。
$("[attribute$=value]")选择每个具有href属性值并以“ .org”结尾的<a>元素:
$(document).ready(function(){
$("a[href$='.org']").css({"background":"green", "color":"white"});
});测试看看‹/›| 参数 | 描述 |
|---|---|
| attribute | 指定要选择的属性名称 |
| value | 指定值应以结尾的字符串 |