aboutsummaryrefslogtreecommitdiff
path: root/src/common.js
blob: a3309d9022753b7841f1da69cddef18a6377fa03 (plain)
1
2
3
4
5
6
7
8
9
10
11


//https://stackoverflow.com/questions/10309650/add-elements-to-the-dom-given-plain-text-html-using-only-pure-javascript-no-jqu
//lets me add elements without fucking up listeners
function appendHtml(el, str) {
  var div = document.createElement('div');
  div.innerHTML = str;
  while (div.children.length > 0) {
    el.appendChild(div.children[0]);
  }
}