logoalt Hacker News

onion2kyesterday at 4:35 PM2 repliesview on HN

it's not at all clear which is which from the names

There's setHTML and setHTMLUnsafe. That seems about as clear as you can get.


Replies

entunoyesterday at 5:16 PM

If that'd been the design from the start, then sure. But it's not at all obvious that setHTML is safe with arbitrary user input (for a given value of "safe") and innerHTML is dangerous.

hahn-kevyesterday at 4:40 PM

But you can use InnerHTML to set HTML and that's not safe.

show 1 reply