Extends: CharacterData
See: https://developer.mozilla.org/en-US/docs/Web/API/Text
- 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)
Creates an instance of Text.
| Param | Type |
|---|---|
| document | \* |
| textContent | \* |
Default: ""#text""
Read only
Default: Node.TEXT_NODE
Read only
Read only
Read only
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
Read only
Read only
| Param | Type |
|---|---|
| offset | \* |
| count | \* |
| Param | Type |
|---|---|
| arg | string |
| Param | Type |
|---|---|
| offset | number |
| arg | string |
| Param | Type |
|---|---|
| offset | number |
| count | number |
| Param | Type |
|---|---|
| offset | number |
| count | number |
| arg | string |
| Param | Type |
|---|---|
| deep | boolean |
| Param | Type |
|---|---|
| child | Node |
| Param | Type |
|---|---|
| child | Node |
| before | Node |
| Param | Type |
|---|---|
| newChild | Node |
| oldChild | Node |
| Param | Type |
|---|---|
| child | Node |
| Param | Type |
|---|---|
| ...nodes | Array.<Node> |
| Param | Type |
|---|---|
| ...nodes | Array.<Node> |
| Param | Type |
|---|---|
| ...nodes | Array.<Node> |
| Param | Type |
|---|---|
| node | Node |
| Param | Type | Default |
|---|---|---|
| eventName | \* |
|
| callback | \* |
|
| [capture] | boolean |
false |
| Param | Type | Default |
|---|---|---|
| eventName | \* |
|
| callback | \* |
|
| [capture] | boolean |
false |
| Param | Type |
|---|---|
| event | \* |