dom-to-selector
v1.0.5
Published
Generates unique selector for DOM Node.
Downloads
4
Maintainers
Readme
dom-to-selector
Generates unique selector for DOM Node.
Installation
npm install --save dom-to-selector
Usage
const dom = require('dom-to-selector');
const node = document.getElementsByClassName('foo')[0];
const selector = dom.stringify(node);
console.log(node === dom.parse(selector)); //true
Tests
npm test