function c(tag, parent, className, text) {
    let element
    if (typeof tag === 'string') {
      element = document.createElement(tag)
    } else if (tag.element) {
      element = tag.element
    } else {
      element = tag
    }
    if (className) {
      element.className = className
    }
    if (text) {
      element.innerHTML = text
    }
    if (parent) {
      parent.appendChild(element)
    }
    return element
  }
/*
   * Method for creating and adding elements.
   * @param {string/object} tag
   * @param (object) parent
   * @param (string) className
   * @param (string) text
   * @return {object}
   */
Method for creating and adding elements.
Method for creating and adding elements .
function c(tag, parent, className, text) {
    let element
    if (typeof tag === 'string') {
      element = document.createElement(tag)
    } else if (tag.element) {
      element = tag.element
    } else {
      element = tag
    }
    if (className) {
      element.className = className
    }
    if (text) {
      element.innerHTML = text
    }
    if (parent) {
      parent.appendChild(element)
    }
    return element
  }
function c ( tag , parent , className , text ) { let element if ( typeof tag === 'string' ) { element = document . createElement ( tag ) } else if ( tag . element ) { element = tag . element } else { element = tag } if ( className ) { element . className = className } if ( text ) { element . innerHTML = text } if ( parent ) { parent . appendChild ( element ) } return element }
Method for creating and adding elements.
Method for creating and adding elements .