Reputation: 8582
insertAdjacentHTML() doesn’t corrupt what’s already in the DOM.
I just read this on the Mozilla blog about the implementation of insertAdjacentHTML(). What does it mean ?
Upvotes: 1
Views: 186
Reputation: 8220
insertAdjacentHTML() parses the specified text as HTML or XML and inserts the resulting nodes into the DOM tree at a specified position
https://developer.mozilla.org/en/DOM/element.insertAdjacentHTML
Upvotes: 0
Reputation: 943214
It means it doesn't serialise the DOM inside the element to HTML, append the new HTML, then generate a new DOM from that (which would create new elements, breaking references, event handlers, etc).
Upvotes: 4