#Zegnatdoosboox: what capjamesg[d] sounds correct. There is a lot of talk about this with JS frameworks ("virtual DOM" and DOM diffing) but at the end of the day the easiest way is to use after/insertAdjacentElement/insertBefore (depending on browser support you are aiming for)