code: function closestTo (element, selector, target) {
    let closestElement = closest(element, selector)
    return contains(target, closestElement) ? closestElement : null
  }
docs: Find the nearest element that matches the selector from current element to target element.
  
  @param {HTMLElement} element element
  @param {string} selector element selector
  @param {HTMLElement} target target element
  @return {?HTMLElement}