Home  >  Article  >  Web Front-end  >  Knowledge about childNodes and children

Knowledge about childNodes and children

一个新手
一个新手Original
2017-10-09 09:38:071187browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn