changed element empty with replaceWith

The solution before did not work for me. I think it's better to use replaceWith in this case.