根据官方的建议:具有 true 和 false 两个属性的属性,如 checked, selected 或者 disabled 使用prop(),其他的使用 attr()
To retrieve and change DOM properties such as the checked, selected, or disabled state of form elements, use the .prop() method.
经验 做项目时记得用prop('checked',true)设置状态时生效
具有 true 和 false 两个属性的属性,如 checked, selected 或者 disabled 使用prop(),其他的使用 attr(),具体见下表:
