javascript node element
来源:互联网 发布:浪潮软件利好消息 编辑:程序博客网 时间:2024/06/07 03:31
Node
(W3C DOM Core object)
SPEC Version Depr. DOM1NO
Node
(W3C DOM Core object)Description
The Node
interface is the primary data type for the Document Object Model (DOM). It represents any single item in the tree, such as an Element
, Attr
, Document
or Entity
.
Whether a Node
may have children depends on its type.
The following table is an overview of each of the core interfaces, showing how thenodeName
and nodeType
returns, and what kind of children the node is allowed to have.
nodeName
nodeType
Element
The tag name, eg.HTML
1
Element
, Text
, Comment
,ProcessingInstruction
,CDATASection
,EntityReference
Attr
The attribute name, eg.id
2
Text
, EntityReference
1Text
#text
3
Cannot have childrenCDATASection
#cdata-section
4
Cannot have childrenEntityReference
The name of the entity reference, eg. amp
5
Element
,ProcessingInstruction
,Comment
, Text
,CDATASection
,EntityReference
Entity
The entity name, eg.&
6
Element
,ProcessingInstruction
,Comment
, Text
,CDATASection
,EntityReference
ProcessingInstruction
The target of the processing instruction, eg. xml-stylesheet
7
Cannot have childrenComment
#comment
8
Cannot have childrenDocument
#document
9
Element
(one only),ProcessingInstruction
,Comment
, DocumentType
(one only)DocumentType
The name of the document type, eg.html
10
Cannot have childrenDocumentFragment
#document-fragment
11
Element
,ProcessingInstruction
,Comment
, Text
,CDATASection
,EntityReference
Notation
The notation name12
Cannot have childrenIn this Section
- appendChild
Add a new node and its subtree to the end of the list of children of this node. - attributes
An unordered list of all the effective attributes that apply to an element. - childNodes
An ordered list of all the child nodes of this node. - cloneNode
Create a duplicate of this node, including all attributes and their values. - firstChild
The first node that is a direct child of this node. - hasAttributes
Whether an element has any attributes. - hasChildNodes
Returns whether this node has any child nodes. - insertBefore
Insert a new node as a child of this node, directly before an existing child of this node. - isSupported
Whether a specific feature of the DOM is implemented, and supported by this node. - lastChild
The last node that is a direct child of this node. - localName
The name of an element or attribute, not including any namespace prefix. - namespaceURI
The namespace URI of an element or attribute node. - nextSibling
The node immediately after this node. - nodeName
The name of this node, according to its type. - nodeType
A numeric code that represents the type of this node. - nodeValue
The value if this node, if it has one. - normalize
Puts this node's sub-tree in a state whereby only structural nodes separate text nodes. - ownerDocument
The document which contains this node. - parentNode
The parent of this node. - prefix
The namespace prefix of this node. - previousSibling
The node immediately before this node. - removeChild
Removes a specified node from the children of this node. - replaceChild
Replace an existing child of this node with a new child node.
Element
(W3C DOM Core object)
NODE
Description
The Element
interface inherits from Node
, and represents a single element in an HTML or XML document.
An Element
node may have other Element
, Text
, Comment
, ProcessingInstruction
,CDATASection
or EntityReference
nodes as children.
In this Section
- getAttribute
Get the value of an attribute with the specified name. - getAttributeNode
Get an attribute node with the specified name. - getAttributeNodeNS
Get the value of an attribute with the specified name and namespace URI. - getAttributeNS
Get the value of an attribute with the specified name and namespace URI. - getElementsByTagName
Retrieves an ordered list of all elements with a given tag name, that are descendants of this document or element, in the linear order in which they appear in the DOM tree. - getElementsByTagNameNS
Retrieves an ordered list of all elements with a given localName and namespaceURI, that are descendants of this document or element, in the linear order in which they appear in the DOM tree. - hasAttribute
Whether this element has an attribute with the specified name, or has a specific default value for that attribute in this document type. - hasAttributeNS
Whether this element has an attribute with the specified local name and namespace URI, or has a specific default value for that attribute in this document type. - removeAttribute
Remove an attribute with the specified name. - removeAttributeNode
Remove a specified attribute node. - removeAttributeNS
Remove an attribute with the specified name and namespace URI. - setAttribute
Set a new attribute on this element, with the specified name and value. - setAttributeNode
Add an attribute node to this element. - setAttributeNodeNS
Add a namespaced attribute node to this element. - setAttributeNS
Set a new attribute on this element, with the specified local name, namespace URI and value. - tagName
The qualified name of an element (including any namespace prefix).
0 0
- javascript node element
- DOM Node Element Attr
- node与element
- xml-----------node 与 element
- JavaScript中Element与Node的区别,children与childNodes的区别
- JavaScript中Element与Node的区别,children与childNodes的区别
- JavaScript中Element与Node的区别,children与childNodes的区别
- JavaScript中Element与Node的区别,children与childNodes的区别
- JavaScript中Element与Node的区别,children与childNodes的区别
- Node和Element的区别
- 原生JS拖拽Element Node
- node和element的区别
- javascript node
- JavaScript node
- javascript 动态创建Element
- JavaScript Element(元素)
- javaScript Element对象
- Get element by JavaScript
- 快速排序
- javascript常用加入收藏与设为首页代码
- MFC内部运行来龙去脉追踪
- shell编程空格的使用
- Android系统onKeyDown监控/拦截/监听/屏蔽返回键、菜单键和Home键
- javascript node element
- SQL2008 数据库根据事物日志的还原
- 为什么我写的文章没了?
- HDU 4970 Killing Monsters 离线 差分
- Codeforces Round #262 (Div. 2) B
- 如何解决Xcode5上传应用时找不到图标的问题。
- 用KMP来求字符串的循环节
- 校验中文长度和英文长度
- EL表达式