Text
Extends: CharacterData
See: https://developer.mozilla.org/en-US/docs/Web/API/Text
-
- new Text(document, textContent)
- .nodeName :
string - .nodeType :
number - .data :
string - .textContent :
string - .nodeValue :
string - .length :
number - .contentEditable
- .isConnected :
boolean - .parentNode :
Node - .parentElement :
Element - .firstChild :
Node - .lastChild :
Node - .previousSibling :
Node - .nextSibling :
Node - .firstElementChild :
Node - .lastElementChild :
Node - .previousElementSibling :
Node - .nextElementSibling :
Node - .childNodes :
NodeList - .children :
HTMLCollection - .ownerDocument
- .attributes
- .substringData(offset, count)
- .appendData(arg)
- .insertData(offset, arg)
- .deleteData(offset, count)
- .replaceData(offset, count, arg)
- .hasChildNodes()
- .cloneNode(deep)
- .appendChild(child)
- .insertBefore(child, before)
- .replaceChild(newChild, oldChild)
- .removeChild(child)
- .remove()
- .before(...nodes)
- .after(...nodes)
- .replaceWith(...nodes)
- .contains(node)
- .addEventListener(eventName, callback, [capture])
- .removeEventListener(eventName, callback, [capture])
- .dispatchEvent(event)
new Text(document, textContent)
Creates an instance of Text.
Param
Type
document
\*textContent
\*text.nodeName : string
Default: "\"#text\""
Read only
text.nodeType : number
Default: Node.TEXT_NODE
Read only
text.data : string
text.textContent : string
text.nodeValue : string
text.length : number
Read only
text.contentEditable
Read only
text.isConnected : boolean
Read only
text.parentNode : Node
Read only
text.parentElement : Element
Read only
text.firstChild : Node
Read only
text.lastChild : Node
Read only
text.previousSibling : Node
Read only
text.nextSibling : Node
Read only
text.firstElementChild : Node
Read only
text.lastElementChild : Node
Read only
text.previousElementSibling : Node
Read only
text.nextElementSibling : Node
Read only
text.childNodes : NodeList
Read only
text.children : HTMLCollection
Read only
text.ownerDocument
Read only
text.attributes
Read only
text.substringData(offset, count)
Param
Type
offset
\*count
\*text.appendData(arg)
Param
Type
arg
stringtext.insertData(offset, arg)
Param
Type
offset
numberarg
stringtext.deleteData(offset, count)
Param
Type
offset
numbercount
numbertext.replaceData(offset, count, arg)
Param
Type
offset
numbercount
numberarg
stringtext.hasChildNodes()
text.cloneNode(deep)
Param
Type
deep
booleantext.appendChild(child)
Param
Type
child
text.insertBefore(child, before)
text.replaceChild(newChild, oldChild)
text.removeChild(child)
Param
Type
child
text.remove()
text.before(...nodes)
Param
Type
...nodes
text.after(...nodes)
Param
Type
...nodes
text.replaceWith(...nodes)
Param
Type
...nodes
text.contains(node)
Param
Type
node
text.addEventListener(eventName, callback, [capture])
Param
Type
Default
eventName
\*callback
\*[capture]
booleanfalsetext.removeEventListener(eventName, callback, [capture])
Param
Type
Default
eventName
\*callback
\*[capture]
booleanfalsetext.dispatchEvent(event)
Param
Type
event
\*