Skip to content

Instantly share code, notes, and snippets.

@miguel-leon
Created November 20, 2018 22:37
Show Gist options
  • Save miguel-leon/adfe40d28d6e230fce32fc3521553544 to your computer and use it in GitHub Desktop.
Save miguel-leon/adfe40d28d6e230fce32fc3521553544 to your computer and use it in GitHub Desktop.
parse html and append to element
function appendHtml(element, content) {
const aux = document.createElement(element.tagName);
aux.innerHTML = content;
for (let i = 0; i < aux.children.length; i++) {
element.appendChild(aux.children[i]);
}
}