code: function addElement (type, attrs) {
    runtime.assertBrowser()
  
    // create element
    var el = document.createElement(type)
  
    // add attributes
    if (attrs) Object.keys(attrs).forEach(function (key) {
      if (key === 'text') {
        // text
        el.appendChild(document.createTextNode(attrs.text))
      } else if (key === 'html') {
        // html
        el.innerHTML = attrs.html
      } else if (key === 'click' || key === 'keydown' || key === 'keyup') {
        // events
        el.addEventListener(key, attrs[key])
      } else {
        // any other attributes
        el.setAttribute(key, attrs[key])
      }
    })
  
    extendWithConvenienceMethods(el)
  
    return el
  }
docs: helpers