function removeClassFromElement(node, clazz, delay) {
    let elt = asElement(resolveTarget(node))
    if (!elt) {
      return
    }
    if (delay) {
      getWindow().setTimeout(function() {
        removeClassFromElement(elt, clazz)
        elt = null
      }, delay)
    } else {
      if (elt.classList) {
        elt.classList.remove(clazz)
        // if there are no classes left, remove the class attribute
        if (elt.classList.length === 0) {
          elt.removeAttribute('class')
        }
      }
    }
  }
Removes a class from the given element

@see https://htmx.org/api/#removeClass

@param {Node|string} node element to remove the class from
@param {string} clazz the class to remove
@param {number} [delay] the delay (in milliseconds before class is removed)