(selector).prop(attribute,value) 设置被选元素的属性和值
attr prop区别:对于属性值为true/false的属性,使用 attr() 有时候会出现不一致的行为
适用选择:具有 true 和 false 两个属性的属性,如 checked, selected 或者 disabled 使用prop(),其他的使用 attr()
(selector).prop(attribute,value) 设置被选元素的属性和值
attr prop区别:对于属性值为true/false的属性,使用 attr() 有时候会出现不一致的行为
适用选择:具有 true 和 false 两个属性的属性,如 checked, selected 或者 disabled 使用prop(),其他的使用 attr()