js add html element at position code example Example: javascript appendchild at index parentElement.insertBefore(newElement, parentElement.children[2]);