zw-closest
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

What is it?

Same as $.fn.closest from jQuery, but without jQuery. Does not modify any global objects or prototypes. Gracefully falls back to using native Element.closest and Element.matches if ones are available. The only requirement is native Element.querySelectorAll method, so it is compatible with all browsers except IE <= 7.

Installation

npm i --save zw-closest

Usage

const closest = require('zw-closest');
 
closest(document.body, 'html');

Readme

Keywords

none

Package Sidebar

Install

npm i zw-closest

Weekly Downloads

2

Version

0.0.1

License

MIT

Last publish

Collaborators

  • zenwarr