I am looking for a way to find the full path to an element on click.
For example, lets say I have this HTML code:
i
This is how you can reconstruct the full path:
var q = $(this) .parentsUntil('body') .andSelf() .map(function() { return this.nodeName + ':eq(' + $(this).index() + ')'; }).get().join('>');
Inspired by this answer.