[ Attribute = value ]選擇器用于選擇具有指定屬性和值[ [attribute=value] 的元素。
$("[attribute='value']")選擇每個(gè)<a>元素的href屬性值等于“ / CSS3 /”:
$(document).ready(function(){
$("a[href='/CSS3/']").css({"background":"green", "color":"white"});
});測(cè)試看看?/?| 參數(shù) | 描述 |
|---|---|
| attribute | 指定要選擇的屬性名稱(chēng) |
| value | 指定要選擇的值 |