Home Reference Source

Function

Static Public Summary
public

closest(element: Element, selector: String | Function): Element | null

Get the closest parent element of a given element that matches the given selector string or matching function

Static Public

public closest(element: Element, selector: String | Function): Element | null source

Get the closest parent element of a given element that matches the given selector string or matching function

Params:

NameTypeAttributeDescription
element Element

The child element to find a parent of

selector String | Function

The string or function to use to match the parent element

Return:

Element | null