Home > Web Front-end > JS Tutorial > body text

Knowledge about childNodes and children

一个新手
Release: 2017-10-09 09:38:07
Original
1197 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template