Use replaceWith instead of html (which is innerHTML, not outerHTML)