标签:
//设置单个属性的值
$("img").attr("width", "500px");
//设置多个属性的值
$("img").attr({
"width": function(index, e) {
return index % 2 == 0 ? e - 50 : e;
},
"height": function(index, e) {
return index % 2 == 0 ? e - 50 : e;
}
});
//获得单个元素的属性
var state = $("input").prop("checked");
//反选
$("input").prop("checked", function(index, e) {
return !e;
})
标签:
原文地址:http://www.cnblogs.com/cyclone77/p/4530965.html