Class: Element
Represents an element in the XML document.
Extends
Constructors
Constructor
new Element(
model,ownerDocument):Element
Parameters
model
ownerDocument
Document | null
Returns
Element
Overrides
Properties
CDATA_SECTION_NODE
readonlyCDATA_SECTION_NODE:4=4
Inherited from
COMMENT_NODE
readonlyCOMMENT_NODE:8=8
Inherited from
DOCUMENT_NODE
readonlyDOCUMENT_NODE:9=9
Inherited from
ELEMENT_NODE
readonlyELEMENT_NODE:1=1
Inherited from
model
protectedmodel:ModelElement
Inherited from
ownerDocument
ownerDocument:
Document|null
Inherited from
TEXT_NODE
readonlyTEXT_NODE:3=3
Inherited from
Accessors
childNodes
Get Signature
get childNodes():
NodeList
Returns a NodeList containing all children of this node, respecting the document's filter.
Returns
Inherited from
firstChild
Get Signature
get firstChild():
Node|null
Returns
Node | null
Inherited from
lastChild
Get Signature
get lastChild():
Node|null
Returns
Node | null
Inherited from
localName
Get Signature
get localName():
string
Returns
string
namespaceURI
Get Signature
get namespaceURI():
string|null
Returns
string | null
nextSibling
Get Signature
get nextSibling():
Node|null
Returns
Node | null
Inherited from
nodeName
Get Signature
get nodeName():
string
Returns
string
Overrides
nodeType
Get Signature
get nodeType():
number
Returns
number
Overrides
parentNode
Get Signature
get parentNode():
Node|null
Returns the parent of this node.
Returns
Node | null
Inherited from
prefix
Get Signature
get prefix():
string|null
Returns
string | null
previousSibling
Get Signature
get previousSibling():
Node|null
Returns
Node | null
Inherited from
tagName
Get Signature
get tagName():
string
Returns
string
textContent
Get Signature
get textContent():
string|null
Returns
string | null
Set Signature
set textContent(
value):void
Parameters
value
string | null
Returns
void
Inherited from
Methods
appendChild()
appendChild<
T>(newChild):T
Adds a node to the end of the list of children of a specified parent node.
Type Parameters
T
T extends Node
Parameters
newChild
T
The node to append.
Returns
T
Inherited from
getAttribute()
getAttribute(
name):string|null
Parameters
name
string
Returns
string | null
getModel()
getModel():
ModelNode
Returns
Inherited from
hasAttribute()
hasAttribute(
name):boolean
Parameters
name
string
Returns
boolean
insertBefore()
insertBefore<
T>(newChild,refChild):T
Inserts a node before a reference node as a child of this node.
Type Parameters
T
T extends Node
Parameters
newChild
T
The node to insert.
refChild
The reference node (must be a child of this node).
Node | null
Returns
T
Inherited from
querySelector()
querySelector(
selector):Element|null
Parameters
selector
string
Returns
Element | null
querySelectorAll()
querySelectorAll(
selector):NodeList
Parameters
selector
string
Returns
removeAttribute()
removeAttribute(
name):void
Parameters
name
string
Returns
void
removeChild()
removeChild<
T>(child):T
Removes a child node from the DOM and returns the removed node.
Type Parameters
T
T extends Node
Parameters
child
T
The child node to remove.
Returns
T
Inherited from
replaceChild()
replaceChild<
T>(newChild,oldChild):T
Replaces a child node with a new node.
Type Parameters
T
T extends Node
Parameters
newChild
T
The new node to add.
oldChild
The child node to be replaced.
Returns
T
Inherited from
setAttribute()
setAttribute(
name,value):void
Parameters
name
string
value
string
Returns
void