1. Element.closest()

    DOM method that returns the current element if it matches the given selector, or else the closest ancestor element that matches the given selector, or else null.

  2. element api: closest