Skip to content

JavaScript object that creates a unique CSS selector for a given DOM element. It has no external dependencies.

Notifications You must be signed in to change notification settings

flamencist/SelectorGenerator

Repository files navigation

SelectorGenerator

Built with Gulp devDependency Status Build Status

JavaScript object that creates a unique CSS selector for a given DOM element. It has no external dependencies.

Help support the project:

Buy Me A Coffee

Overview

var generator = new SelectorGenerator();
var element = document.querySelector("input"); // <input type="text" id="login" />
var selector = generator.getSelector(element); //=> #login
var path = generator.getPath(element); //=> body > div > input

Installation

Node.js

To install SelectorGenerator module for Node.js, this command should be used:

npm install selector-generator

Or yarn:

yarn add selector-generator

Tests

You can view the results of the SelectorGenerator test suite in your browser!

License

This software is distributed under the terms of the MIT License (MIT).

Authors

Alexander Chermyanin / LinkedIn

Contributions and bugs reports are welcome.

About

JavaScript object that creates a unique CSS selector for a given DOM element. It has no external dependencies.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published