DOM
SourceReturns a string appropriate for the type of node, as follows:
Element
Its HTML-uppercased qualified name. Attr
Its qualified name. Text
"#text
". CDATASection
"#cdata-section
". ProcessingInstruction
Its target. Comment
"#comment
". Document
"#document
". DocumentType
Its name. DocumentFragment
"#document-fragment
". In all current engines.
Firefox1+Safari1.1+Chrome1+ Opera7+Edge79+ Edge (Legacy)12+IE6+ Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+
The nodeType
getter steps are to return the first matching
statement, switching on this:
Element
ELEMENT_NODE
(1) Attr
ATTRIBUTE_NODE
(2); Text
TEXT_NODE
(3); CDATASection
CDATA_SECTION_NODE
(4); ProcessingInstruction
PROCESSING_INSTRUCTION_NODE
(7); Comment
(8); Document
DOCUMENT_NODE
(9); DocumentType
DOCUMENT_TYPE_NODE
(10); DocumentFragment
DOCUMENT_FRAGMENT_NODE
(11). In all current engines.
Firefox1+Safari7+Chrome1+ Opera12.1+Edge79+ Edge (Legacy)12+IE6+ Firefox for Android4+iOS Safari7+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+
The nodeName
getter steps are to return the
first matching statement, switching on this:
Element
Its HTML-uppercased qualified name. Attr
Its qualified name. Text
"#text
". CDATASection
"#cdata-section
". ProcessingInstruction
Its target. Comment
"#comment
". Document
"#document
". DocumentType
Its name. DocumentFragment
"#document-fragment
". node . baseURI
Returns node’s node document’s document base URL. In all current engines.
Firefox1+Safari7+Chrome1+ Opera12.1+Edge79+ Edge (Legacy)12+IENone Firefox for Android4+iOS Safari7+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+
The baseURI
getter steps are to return this’s node document’s document base URL, serialized.
node . isConnected
Returns true if node is connected; otherwise false.
node . ownerDocument
Returns the node document. Returns null for documents. node . getRootNode()
Returns node’s root. node . getRootNode({ composed:true })
Returns node’s shadow-including root. node . parentNode
Returns the parent. node . parentElement
Returns the parent element. node . hasChildNodes()
Returns whether node has children. node . childNodes
Returns the children. node . firstChild
Returns the first child. node . lastChild
Returns the last child. node . previousSibling
Returns the previous sibling. node . nextSibling
Returns the next sibling. In all current engines.
Firefox53+Safari10+Chrome51+ Opera38+Edge79+ Edge (Legacy)NoneIENone Firefox for Android45+iOS Safari10+Chrome for Android51+Android WebView51+Samsung Internet6.0+Opera Mobile41+
The isConnected
getter steps are to return true,
if this is connected; otherwise false.
In all current engines.
Firefox9+Safari7+Chrome1+ Opera12.1+Edge79+ Edge (Legacy)12+IE6+ Firefox for Android9+iOS Safari7+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+
The ownerDocument
getter steps are to return null,
if this is a document; otherwise this’s node document.
The node document of a document is that document itself.
All nodes have a node document at all times.
In all current engines.
Firefox53+Safari10.1+Chrome54+ Opera41+Edge79+ Edge (Legacy)NoneIENone Firefox for Android53+iOS Safari10.3+Chrome for Android54+Android WebView54+Samsung Internet6.0+Opera Mobile41+
The getRootNode(options)
method steps are to
return this’s shadow-including root if options["composed
"] is true; otherwise this’s root.
In all current engines.
Firefox1+Safari1.1+Chrome1+ Opera7+Edge79+ Edge (Legacy)12+IE5.5+ Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+
The parentNode
getter steps are to return this’s parent.
In all current engines.
Firefox9+Safari1.1+Chrome1+ Opera7+Edge79+ Edge (Legacy)12+IE9+ Firefox for Android9+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+
The parentElement
getter steps are to return this’s parent element.
In all current engines.
Firefox1+Safari1+Chrome1+ Opera12.1+Edge79+ Edge (Legacy)12+IE6+ Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+
The hasChildNodes()
method steps are to return true if this has children; otherwise false.
In all current engines.
Firefox1+Safari1.2+Chrome1+ Opera7+Edge79+ Edge (Legacy)12+IE5+ Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+
The childNodes
getter steps are to return a NodeList
rooted at this matching only children.
In all current engines.
Firefox1+Safari7+Chrome1+ Opera12.1+Edge79+ Edge (Legacy)12+IE6+ Firefox for Android4+iOS Safari7+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+
The firstChild
getter steps are to return this’s first child.
In all current engines.
Firefox1+Safari7+Chrome1+ Opera12.1+Edge79+ Edge (Legacy)12+IE6+ Firefox for Android45+iOS Safari7+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+
The lastChild
getter steps are to return this’s last child.
In all current engines.
Firefox1+Safari7+Chrome1+ Opera12.1+Edge79+ Edge (Legacy)12+IE5.5+ Firefox for Android4+iOS Safari7+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+
The previousSibling
getter steps are to return this’s previous sibling.
In all current engines.
Firefox1+Safari1.1+Chrome1+ Opera7+Edge79+ Edge (Legacy)12+IE5.5+ Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+
The nextSibling
getter steps are to return this’s next sibling.
In all current engines.
Firefox1+Safari7+Chrome1+ Opera12.1+Edge79+ Edge (Legacy)12+IE6+ Firefox for Android4+iOS Safari7+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+
The nodeValue
attribute
must return the following, depending on this:
Attr
this’s value. Text
ProcessingInstruction
Comment
this’s data. Any other node Null. The nodeValue
attribute must,
on setting, if the new value is null, act as if it was the empty string
instead, and then do as described below, depending on this:
Attr
Set an existing attribute value with this and new value.
Text
ProcessingInstruction
Comment
Replace data with node this, offset 0, count this’s length, and data new value.
Any other nodeDo nothing.
In all current engines.
Firefox1+Safari3+Chrome1+ Opera9+Edge79+ Edge (Legacy)12+IE9+ Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+
Read Next page