attribute与property的区别?

简介: 前端面试

attribute是dom元素在文档中作为html标签拥有的属性
property是dom元素在js中作为对象拥有的属性。
所以,对于html的标准属性来说,attribute和property是同步的,是会自动更新的。但对于自定义属性,他们不同步。

相关文章
|
9月前
|
Java 数据库连接 mybatis
There is no getter for property named ‘null‘ in ‘class
There is no getter for property named ‘null‘ in ‘class
114 0
There is no getter for property named ‘null‘ in ‘class
When will the reference ATTRIBUTE_REF of an BOL entity be cleared
When will the reference ATTRIBUTE_REF of an BOL entity be cleared
When will the reference ATTRIBUTE_REF of an BOL entity be cleared
|
TensorFlow 算法框架/工具
has no attribute ‘swish‘
has no attribute ‘swish‘
137 0
|
C语言 编译器 C++
|
C# 编译器 机器人