Open xxleyi opened 4 years ago
The main difference between children and childNodes property is that children work upon elements and childNodes on nodes including non-element nodes like text and comment nodes.
One is element, the other is node.
get name:
element vs node:
一篇超棒的回答:javascript - Difference between Node object and Element object? - Stack Overflow
Element
<p>
<div>
Text
Attr
The main difference between children and childNodes property is that children work upon elements and childNodes on nodes including non-element nodes like text and comment nodes.
One is element, the other is node.
get name:
element vs node:
一篇超棒的回答:javascript - Difference between Node object and Element object? - Stack Overflow
Element
node like<p>
or<div>
.Text
inside anElement
orAttr
.