DPS: use .html and .attr instead of replaceWith

This fix an issue while clinking on an element. It was then impossible to click
a second time on it.