Javascript中的节点是什么? [英] What is a node in Javascript?
问题描述
我想知道JavaScript中的节点到底是什么?
I was wondering what exactly a node is in JavaScript?
如函数中所示:
element.nodeType
row.parentNode.removeChild(row);
推荐答案
在此上下文中,节点是只是一个HTML元素。 DOM是指是表示网站HTML的树形结构,每个HTML元素都是一个节点。请参见文档对象模型(DOM)。
A "node", in this context, is simply an HTML element. The "DOM" is a tree structure that represents the HTML of the website, and every HTML element is a "node". See Document Object Model (DOM).
More specifically, "Node" is an interface that is implemented by multiple other objects, including "document" and "element". All objects implementing the "Node" interface can be treated similarly. The term "node" therefore (in the DOM context) means any object that implements the "Node" interface. Most commonly that is an element object representing an HTML element.
这篇关于Javascript中的节点是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!