Javascript中的节点是什么? [英] What is a node in Javascript?

查看:179
本文介绍了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).

更具体地说,节点是由多个其他对象(包括文档,和元素。实施节点的所有对象都在图2中示出。界面可以类似地对待。术语节点是指节点。因此,(在DOM上下文中)对象是指实现节点的任何对象。接口。最常见的是代表HTML元素的元素对象。

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆