![jQuery [attribute=value] 属性选择器](https://cdn.div.cn/static/images/ff8e218d998ff477df995e9efcdd21e3.png)
[ Attribute = value ]选择器用于选择具有指定属性和值[ [attribute=value] 的元素。
语法:
$("[attribute='value']")实例
选择每个<a>元素的href属性值等于“ / CSS3 /”:
$(document).ready(function(){
$("a[href='/CSS3/']").css({"background":"green", "color":"white"});
});测试看看‹/›参数值
| 参数 | 描述 |
|---|---|
| attribute | 指定要选择的属性名称 |
| value | 指定要选择的值 |