up.element.closest(element, selector)
JavaScript function
This feature has been deprecated. Use Element#closest() instead.
Load unpoly-migrate.js
to polyfill deprecated features.
Returns the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
Parameters
element
selector
required
The CSS selector to match.
Type: string
Return value
element The matching element.
Returns null or undefined if no element matches.
Type: Element | null | undefined