jQuery plugin that returns simplest selector of elements.
Clone or download
Latest commit 0d2f6db Jul 7, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist
libs
src
test
.gitignore
.jshintrc
.travis.yml Update dependencies and fix coffee syntax Apr 9, 2015
CONTRIBUTING.md
Gruntfile.js
LICENSE
LICENSE-MIT
README.md
bower.json Version bump to 0.1.5 Apr 9, 2015
package.json Version bump to v0.1.6 Feb 23, 2016
selectorator.jquery.json

README.md

jQuery Selectorator

jQuery plugin that returns simplest selector of elements.

Build Status

Getting Started

<script src="jquery.js"></script>
<script src="dist/selectorator.min.js"></script>

Documentation

jQuery.fn.getSelector(options = {})

Returns an array of simplest selectors of the element.

jQuery.fn.selectorator(options = {})

Returns Selectorator instance.

jQuery.seletortor.options = []

Default options.

options.ignore.classes = []

options.ignore.names = []

options.ignore.ids = []

options.ignore.class = ''

options.ignore.name = ''

options.ignore.id = ''

String or Array of values to ignore from generated selectors.

Examples

$("a").on("click", function(){
  alert($(this).getSelector().join("\n"));
  return false;
});

Testing

$ npm install
$ npm test

Author

License

MIT License