HTML DOM Element insertAdjacentText()
HTML DOM Element insertAdjacentText() Method
The insertAdjacentText() method is used for inserting text into a specified position.
Some positions are:-
Value | Description |
---|---|
afterbegin | After the beginning of the element of the first child. |
afterend | After the element. |
beforebegin | Before the element. |
beforeend | Before the end of the element of the last child. |
Syntax:-
Its syntax is:- element.insertAdjacentText(position, text) OR node.insertAdjacentText(position, text)
Further Explanation:-
Parameter | Description |
position | Required. Position relative to the element. |
text | The text to insert. |