dom

 

继承在dom中的重要性,以下为a标记继承关系图

 

 


 

从图中可以看到NODE是核心,查阅w3c可以知道 node 的相关

http://www.w3.org/wiki/DOM/domcore/Node#DOM_Core_reference

Node

The Node interface is the primary datatype for the entire DOM. It represents a single node in the document tree. While all objects implementing the Node interface expose methods for dealing with children, not all objects implementing the Node interface may have children. For example, Text nodes may not have children, and adding children to such nodes results in a DOMException being raised.

Attributes

Name Description
nodeType Returns the type of this node.
nodeName Returns the name of this node.
baseURI Returns the absolute base URI of this node or null if the implementation wasn't able to obtain an absolute URI.
ownerDocument Returns the top level document object for this node.
parentNode Returns the parent of this node in the DOM tree.
parentElement Returns the parent element of this node in the DOM tree.
childNodes Returns the child of this node in the DOM tree.
firstChild Returns the first child of this node in the DOM tree.
lastChild Returns the last child of this node in the DOM tree.
previousSibling Returns the node immediately preceding this node.
nextSibling Returns the node immediately following this node..
nodeValue Returns the value of this node.
textContent Returns this attribute returns the text content of this node and its descendants.

 

 

Methods

Name Description
hasChildNodes() Returns whether this node has any children.
compareDocumentPosition(other) ...
insertBefore(newChild, refChild) Inserts the node newChild before the existing child node refChild.
replaceChild(newChild, oldChild) Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node.
removeChild(oldChild) Removes the child node indicated by oldChild from the list of children, and returns it.
appendChild(newChild) Adds the node newChild to the end of the list of children of this node.
cloneNode(deep) ...
isSameNode(node) Returns whether this node is the same node as the given one.
lookupPrefix(namespace) Look up the prefix associated to the given namespace URI, starting from this node.
lookupNamespaceURI(prefix) Look up the namespace URI associated to the given prefix, starting from this node.
isDefaultNamespace(namespace)

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值