JQ中的attr和prop方法

来源:互联网 发布:windows一键还原按什么 编辑:程序博客网 时间:2024/05/24 03:16

啥也不说了,注意坑,如果你在使用attr的时候发现明明在行间已经加上了该属性但实际却无法生效那就尝试一下prop吧!贴一张官方推荐的是使用attr还是prop的表格:

Attribute/Property.attr().prop()accesskey√ align√ async√√autofocus√√checked√√class√ contenteditable√ draggable√ href√ id√ label√ location ( i.e. window.location )√√multiple√√readOnly√√rel√ selected√√src√ tabindex√ title√ type√ width ( if needed over .width() )√ 

0 0
原创粉丝点击