How to append a childnode to a specific position December 26, 2022 by Tarik You can use .insertBefore(): parentElement.insertBefore(newElement, parentElement.children[2]);