An open API service indexing awesome lists of open source software.

https://github.com/ashiknesin/closest-link

Find closest hyperlink in DOM element
https://github.com/ashiknesin/closest-link

dom dom-element dom-utilities hyperlink javascript

Last synced: 11 months ago
JSON representation

Find closest hyperlink in DOM element

Awesome Lists containing this project

README

          

> Find closest hyperlink in DOM element

## Install

```
$ npm install --save closest-link
```

## Usage

```html

Here is link
Here is outer-span
Here is inner-span

```

```js
const closestLink = require('closest-link');
const targetElement = document.querySelector('#inner-span')
closestLink(targetElement);
//=> '...'
```

## License

MIT © [Ashik Nesin](https://ashiknesin.com)