javascript appendchild at index

JavaScript
parentElement.insertBefore(newElement, parentElement.children[2]);
Source

Also in JavaScript: