Did jQuery drop support to attr on some DOM properties?
This question already has an answer here:
jQuery 1.6 introduced the .prop() method for setting or getting properties on nodes and deprecated the use of .attr() to set properties. However, versions up to 1.9 continued to support using .attr() for specific situations. This behavior in the name of backwards compatibility causes confusion when selectors are used that distinguish between attributes and properties.
Have a look at this upgrade guide from jQuery itself. .attr() versus .prop()
链接地址: http://www.djcxy.com/p/27546.html上一篇: 用Jquery改变属性状态