Is an Element an instance of a Node in HTML?

删除回忆录丶 提交于 2019-12-11 11:28:29

问题


Is an Element an instance of a Node in HTML?

I presume Attributes are also Nodes and that "the Elements" is the set of Nodes that can be defined using the angle-bracket syntax?


回答1:


Yes it is a Node, according to the MDN documentation for HTMLElement :

Inherits properties from its parents Node, and its own parent, EventTarget, and implements those of ParentNode, ChildNode, NonDocumentTypeChildNode, and Animatable.

If that's a bit hard to find in text, MDN also provides an "Inheritance section" in the left sidebar.




回答2:


Properties

Inherits properties from its parents Node, and its own parent, EventTarget, and implements those of ParentNode, ChildNode, NonDocumentTypeChildNode, and Animatable.

https://developer.mozilla.org/en-US/docs/Web/API/Element



来源:https://stackoverflow.com/questions/33652571/is-an-element-an-instance-of-a-node-in-html

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!