Any suggestions on how to create a CSS path for an element?
The CSS path is the path of the css selectors needed to identify a specific element, for example, if my html is:
<div id="foo"> <div class="bar"> <ul> <li>1</li> <li>2</li> <li><span class="selected">3</span></li> </ul> </div> </div>
then the class path to "3" will be div#foo div.bar ul li span.selected
JQuery uses class paths to identify DOM elements and may provide a good solution, but so far I have not been able to find it.
javascript css
dingdingding
source share