Get CSS path to an element.
JavaScript
Switch branches/tags
Nothing to show
Latest commit 59d6753 Dec 15, 2012 @timoxley Fix example
Permalink
Failed to load latest commit information.
examples/highlight Rename test/examples. Nov 14, 2012
test Rename test/examples. Nov 14, 2012
.DS_Store Initial Commit Nov 4, 2012
.gitignore
Makefile
Readme.md Fix example Dec 15, 2012
component.json Release 0.0.2 Nov 14, 2012
index.js

Readme.md

css-path

Get absolute path to a DOM element as a CSS selector.

Example

<div class="page">
  <h3 id="header">Header Level 3</h3>
  <ul class="list">
     <li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
     <li>Aliquam tincidunt mauris eu risus.</li>
  </ul>
</div>

CSS path of first li:

body > div.page:nth-child(1) > ul.list:nth-child(2) > li:nth-child(1)

Licence

MIT