-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[js] 第159天 在js中attribute和property的区别是什么? #1235
Comments
|
@justjavac 的最后一项, |
@justjavac 在理解的基础上,用一句话概括:浏览器解析之前全都是特性,解析之后分情况:标准特性的值将被解析并挂载到 DOM属性上,非标准特性只可用DOM的 这样说应该问题不大吧? |
@foreverZ133 非标准的不做任何映射,只能通过 |
噢,一个会改变 html 一个不会,突然冒出来个特性搞蒙了,Thanks |
1、property和attributies都是properties的子集,而每个attribute是attributies的子集; property能够从attribute中得到同步; |
property是DOM中的属性,DOM是JavaScript里的对象; |
attribute是特性,一般是用于自定义特性,例:data-xx=“xxx” 可以使用getAttribute('data-xx')获取,且只能是字符串。 |
第159天 在js中attribute和property的区别是什么?
The text was updated successfully, but these errors were encountered: