lundi 2 mars 2015

How to get css selector for an element using javascript?


Is there any jQuery plugin or javascript code that returns a CSS-selector that uniquely selects a particular element?


I'm looking for something with similar functionality as provided by the Copy CSS Path function in Chrome's developer tools, giving me a selector that looks something like this:



#question > table > tbody > tr:nth-child(2) > td > div > h2


Answers I tried


Get unique selector of element in Jquery


Get unique selector jQuery





Aucun commentaire:

Enregistrer un commentaire