Use innerHTML instead of appendChild(document.createTextNode())