I am using insertAdjacentElement method to add an element before another already existing one. While this works properly when I insert before a text element, wh
insertAdjacentElement