Skip to content

Latest commit

 

History

History
16 lines (13 loc) · 834 Bytes

README.md

File metadata and controls

16 lines (13 loc) · 834 Bytes

Acquire anchor

npm version Build Status Coverage Status MIT Licensed

A function that given a node will return the nearest anchor node starting at the passed node and walking up the tree until there are no more parent nodes.

To use

var acquireAnchor = require('acquire-anchor');
var childNode = document.querySelector('.child-node');

var anchorNode = acquireAnchor(childNode);