I need a way to add HTML to a container element without using innerHTML. The reason I don't want to use innerHTML is because when it is used as follows:
element.innerHTML += htmldata
It works by replacing all html with the first before adding the old html and new html. This is not good because it resets dynamic media such as built-in flash movies ...
I could do it in a way that works:
var e = document.createElement('span'); e.innerHTML = htmldata; element.appendChild(e);
However, the problem is that this document has that extra span tag that I don't need.
How can I do that? Thank!
javascript html innerhtml
Bob Jun 10 2018-11-11T00: 00Z
source share