Replace child elements with replaceChild() - JavaScript DOM Tutorial ...

Replace child elements with replaceChild() - JavaScript DOM Tutorial ...

More to explore