Did jQuery drop support to attr on some DOM properties?

This question already has an answer here:

  • .prop() vs .attr() 17 answers

  • 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改变属性状态

    下一篇: jQuery是否在某些DOM属性上放弃了对attr的支持?