Add HTML element abstraction
Javascript
/**
 * Simple abstraction for adding an HTML element to a parent element
 * @param {string} type
 * @param {string} text
 * @param {string} parent
 * @param {object} options
 * @returns {HTML Element} Created element
 */
function addElement (type, text, parent, options) {
  parent = parent || '#app'
  let container = document.querySelector(parent)
  let elem = document.createElement(type)

  if (text) {
    let textElem = document.createTextNode(text)
    elem.appendChild(textElem)
  }

  for (let option in options) {
    elem[option] = options[option]
  }

  container.appendChild(elem)
  return elem
}