jquery中的attr和prop有什么区别? 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(). 设置check等属性