
自 jQuery 1.6 版本起,attr()方法对于未设置的 attributes(即标签中没写该 attribute),都会返回 undefined。对于获取和改变 DOM 的 properties,如表单元素的 checked、selected 或 disabled 状态,应使用 .prop() 方法。
你的支持,是对博主最大的鼓励。猛戳这里,右上角给点个Star吧!>>>

自 jQuery 1.6 版本起,attr()方法对于未设置的 attributes(即标签中没写该 attribute),都会返回 undefined。对于获取和改变 DOM 的 properties,如表单元素的 checked、selected 或 disabled 状态,应使用 .prop() 方法。
你的支持,是对博主最大的鼓励。猛戳这里,右上角给点个Star吧!>>>
近期评论