es6-DOM-closest

1.0.1 • Public • Published

es6-DOM-closest

Returns the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. A simple replacement for jQuery's .closest().

Example

    import DOM from "./node_modules/es6-DOM-closest/dist/main";
    console.log( DOM.closest(document.body, "body") ); // => <body></body>

Package Sidebar

Install

npm i es6-DOM-closest

Weekly Downloads

0

Version

1.0.1

License

BSD-3-Clause

Last publish

Collaborators

  • martinkr