精华:
To retrieve and change DOM properties such as the checked, selected, or disabled state of form elements, use the .prop() method.
根据官方的建议:具有 true 和 false 两个属性的属性,如 checked, selected 或者 disabled 使用prop(),其他的使用 attr()
曾亲自使用过prop()滴地方
select: option.prop("selected", true);
checkbox:$("#xxx").prop("checked")
disabled :$(this).prop("disabled", false);
因为使用prop报错失败的地方
style :.prop("style ", "xxxxxxxxxxxxxxxx");
xxxxxxxxxxxxxx
省略了吧
有张列表图:可以看看。