←back to thread

Element: setHTML() method

(developer.mozilla.org)
167 points todsacerdoti | 1 comments | | HN request time: 0.208s | source
Show context
michalpleban ◴[] No.45674843[source]
So is this basically a safe version of innerHTML?
replies(2): >>45674953 #>>45677088 #
intrasight ◴[] No.45677088[source]
I'm confused as to why you need a "safe" version if you're the one generating and injecting the HTML.
replies(5): >>45677311 #>>45677377 #>>45678388 #>>45678704 #>>45679220 #
1. matmo ◴[] No.45677377[source]
Isn't this kinda like asking "why does my gun need a safety if I'm the only one consciously pulling the trigger"?