logoalt Hacker News

itishappyyesterday at 3:11 PM1 replyview on HN

That's the whole point of the setHTML.

How would I set a header level using textContent?


Replies

Aachenyesterday at 3:20 PM

The traditional way: separating data and code

    document.createElement("h1").textContent = `Hello, ${username}!`
If you allow <h1> in the setHTML configuration or use the default, users with the tag in their username also always get it rendered as markup
show 2 replies