logoalt Hacker News

hahn-kevyesterday at 4:40 PM1 replyview on HN

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


Replies

onion2kyesterday at 5:41 PM

At this point that API has been around for decades and is probably impossible to deprecate without breaking fairly large amounts of the web. The only option is to introduce a new and better API, and maybe eventually have the browser throw out console warnings if a page still uses the old innerHTML API. I doubt any browser vendor will be gung ho enough to actually remove it for a very long time.