When setting the outerText, the entire element gets replaced.
Click the button to change (and remove) the h1 element: