dom-to-selector

1.0.5 • Public • Published

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

License

MIT

Package Sidebar

Install

npm i dom-to-selector

Weekly Downloads

1

Version

1.0.5

License

MIT

Last publish

Collaborators

  • feerzlay