code: function (node, match) {
        do {
          if (!node || node.nodeName.toLowerCase() === match) {
            break
          }
          node = node.parentNode
        } while (node)
  
        return node
      }
docs: Get the nearest ancestor element of a node that matches a given tag name