Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript标准参考教程中dom模型概述有一段话描述是不是有问题. #329

Closed
bosens-China opened this issue Jun 26, 2018 · 3 comments

Comments

@bosens-China
Copy link

浏览器原生提供document节点,代表整个文档。
文档的第一层只有一个节点,就是 HTML 网页的第一个标签,它构成了树结构的根节点(root node),其他 HTML 标签节点都是它的下级节点。

文档第一层不应该是文档类型么

@bosens-China
Copy link
Author

这个章节下的2.1有一段代码演示,不过这个应该是css样式出现了问题,文字变成黑色了
document.nodeType // 9

@bosens-China
Copy link
Author

2.7Node.nextSibling
有一句说注意,该属性还包括文本节点和评论节点。因此如果当前节点后面有空格,该属性会返回一个文本节点,内容为空格。
老师如何理解评论节点

@ruanyf
Copy link
Owner

ruanyf commented Jun 27, 2018

(1)文档的第一个节点是<html>

(2)谢谢指出,已经更正。

(3) 评论节点就是注释节点<!-- comment -->,我改掉了。

@ruanyf ruanyf closed this as completed Jun 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants