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