I want to find all li.item descendants of ul.level-1:
$('ul.level-1').find('li.item')
and then get the full selector path like ul.level-1 > li > ul.level-2 > li > ul.level-3 > li.item
, so I can pass this selector to a jQuery plugin, that accepts only strings.
Is there any function/plugin for finding the selector path?
<ul class="level-1">
<li>I</li>
<li>II
<ul class="level-2">
<li>A</li>
<li>B
<ul class="level-3">
<li class="item">1</li>
<li class="item">2</li>
<li class="item">3</li>
</ul>
</li>
<li>C</li>
</ul>
</li>
<li>III</li>
</ul>