Node.appendText method
Node › appendText
Official
Appends a text node to the node.Signature:
appendText(val: string): voidParameters:
| Parameter | Type | Description |
|---|---|---|
| val | string | The text to append. |
Returns: void
Example:
const parent = createEl('p');parent.createEl('strong', { text: 'foo' });parent.appendText('bar');console.log(parent); // <p><strong>foo</strong>bar</p>