jQueryGetPath is a simple jQuery extension to get the CSS Path of any element in the DOM as uniquely as possible.
-
Install using bower
bower install jquery-get-path
Include the jQueryGetPath.js file in your project
-
Download source from GitHub
jQuery(element).getPath(); //That's all you need
- Works with jQuery 1.x and 2.x
- Easy to use
- Errs on the side of specificity
- Chrome (latest 2)
- Firefox (latest 2)
- Internet Explorer 8+
- Opera (latest 2)
- Safari (latest 2)
Anyone and everyone is welcome to contribute.
The code is available under the MIT license.
Credit to HTML5 Boilerplate for helping me build out this sample