JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 47614
  • Score
    100M100P100Q144840F
  • License MIT

Given a DOM node, return a unique CSS selector matching only that element

Package Exports

  • unique-selector

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (unique-selector) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

unique-selector

Build Status

Given a DOM node, return a unique CSS selector matching only that element. This is particularly useful when tracking in custom variables in analytics:

document.addEventListener('click', function(event) {
    var selector = unique(event.target);

    _gaq.push(['_trackEvent', 'Engagement', 'Click', selector]);
}, false);

Installation

component install ericclemmons/unique-selector

Tests

$ npm install
$ make
$ open test/index.html

Releases

  • v0.0.2

    • Fix bug with nth-child calculuation
  • v0.0.1

    • Initial release

License

MIT