logoalt Hacker News

piccirelloyesterday at 3:33 PM1 replyview on HN

`setHTML` is meant as a replacement for `innerHTML`. In the use case you describe, you would have never wanted `innerHTML` anyway. You'd want `innerText` or `textContent`.


Replies

iLoveOncallyesterday at 6:44 PM

But that's what setHTML isn't at all a replacement for innerHTML.

You still need innerHTML when you want to inject HTML tags in the page, and you could already use innerText when you didn't want to.

Having something in between is seriously useless.

show 1 reply