canisoon

Element.closest()

96.29

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.