What is a node in Javascript?

后端 未结 4 1298
隐瞒了意图╮
隐瞒了意图╮ 2021-01-30 03:14

I was wondering what exactly a node is in JavaScript?

As in the functions:

element.nodeType
row.parentNode.removeChild(row);
4条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-30 03:56

    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.

提交回复
热议问题