function createElement(className, tagName, appendToEl) {
  const el = document.createElement(tagName);

  if (className) {
    el.className = className;
  }

  if (appendToEl) {
    appendToEl.appendChild(el);
  }

  return el;
}
@template {keyof HTMLElementTagNameMap} T
@param {string} className
@param {T} tagName
@param {Node} [appendToEl]
@returns {HTMLElementTagNameMap[T]}