Home >Web Front-end >JS Tutorial >Knowledge about childNodes and children
1. childNodes.
will treat comments, empty text, non-empty text, and labels as nodes.
2. children:
Only label elements will be found in IE8 and later versions. Excludes text, empty text, and comments.
In versions prior to IE8, label elements and comments will be found, but non-empty text and empty text will not be included.
So to control child elements, it is more convenient to use children. But you need to pay attention to versions before IE8.
The above is the detailed content of Knowledge about childNodes and children. For more information, please follow other related articles on the PHP Chinese website!