Y
Hacker News
new
|
ask
|
show
|
jobs
by
jfengel
242 days ago
I like React's dangerouslySetInnerHTML. The name so clearly conveys "you can do this but you really, really, really shouldn't".
1 comments
domenicd
242 days ago
Indeed, the web platform now has setHTML() and setHTMLUnsafe() to replace the innerHTML setter.
There's also getHTML() (which has extra capabilities over the innerHTML getter).
link
meowface
241 days ago
Okay, I've changed my mind and agree this is better, then. I wasn't aware they were adding two new methods. That is the safest way to do it.
link
There's also getHTML() (which has extra capabilities over the innerHTML getter).