closest-link
0.1.0 • Public • Published
Find closest hyperlink in DOM element
Install
$ npm install --save closest-link
Usage
<article>
<a href="https://ashiknesin.com">Here is link
<span id="outer-span">Here is outer-span
<span id="inner-span">Here is inner-span</span>
</span>
</a>
</article>
const closestLink = require('closest-link');
const targetElement = document.querySelector('#inner-span')
closestLink(targetElement);
License
MIT © Ashik Nesin
Versions
Current Tags
- VersionDownloads (Last 7 Days)
- 0.1.0
2
Version History
- VersionDownloads (Last 7 Days)
- 0.1.0
2
Package Sidebar
Install
Weekly Downloads