code: function closest(element, test) {
    var el = element;
  
    while (el) {
      if (test(el)) {
        return el;
      }
      el = el.parentNode;
    }
  
    return null;
  }
docs: Find first element that tests true, starting with the element itself
  and traversing up through its ancestors
  @param  {Element} element
  @param  {Function} test fn - return true when element located
  @return {Element}