instead of output.push use log_element.appendChild(document.createTextNode(...));