The `textContent` setter also does this. E.g. you can do this:
const span = document.createElement('span')
span.textContent = text
return span.innerHTML