Function: toBack()
ts
function toBack(el): void;Moves the given element to the back of its parent's children.
Parameters
| Parameter | Type | Description |
|---|---|---|
el | HTMLElement | The element to move to the back. |
Returns
void
Example
ts
const parent = document.createElement('div')
const a = document.createElement('span')
const b = document.createElement('span')
parent.appendChild(a)
parent.appendChild(b)
toBack(a)
console.log(parent.lastElementChild === a)Since
1.0.0