HTML中的property和attribute区别
property和attribute的区别:
property
/*
* property:
* 就是js原生对象的直接属性
* */
var whc = {
name: "whc",
height: "180"
}
attribute
<!--
attribute:
就是html标签中预定义和自定义的属性
-->
<input type="checkbox" checked="checked" whc="whc">
两者的关系:
我们可以看到,whc这个node节点对象所拥有的property中出现了Attributes,而我们定义在input标签中的属性也出现其中,基本可以理解成html标签中的attribute属于js中node节点中的property。