title: get all parents in <ul><li> structure using jquery
body: <p>i have the below structure in HTML, which i use to create a tree structure using jquery.</p>
  
  <pre><code>&lt;ul&gt;
          &lt;li&gt;Grand Parent
              &lt;ul&gt;
                  &lt;li&gt;Parent
                      &lt;ul&gt;
                          &lt;li&gt;child&lt;/li&gt;&lt;/ul&gt;
                  &lt;/li&gt;
              &lt;/ul&gt;
          &lt;/li&gt;
      &lt;/ul&gt;
  </code></pre>
  
  <p>every li element has a radio button next to it (not shown in the code, please assume that).</p>
  
  <p><strong>Now if a select value "Child" from the above code then i should get the below result
  "Grand Parent > Parent > Child"
     and  if i select parent then i should get 
  "Grand Parent > Parent"</strong></p>
  
  <p>So basically the i want to get parent with all its child</p>
  
  <p>Please advise how can i get the above result using jquery</p>
  
  <p><em><strong>section 1</em></strong></p>
  
  <pre><code>&lt;ul class='tree js-catTree'&gt;&lt;li&gt;&lt;a class='expand'&gt;&lt;/a&gt;&lt;span class='treeNodeInner'&gt;&lt;input type='radio' name='category'&gt;&lt;a id='10209'&gt;Business&lt;/a&gt;&lt;ul&gt;&lt;li&gt;&lt;span class='treeNodeInner'&gt;&lt;input type='radio' name='category'&gt;&lt;a id='10212'&gt;Top&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class='treeNodeInner'&gt;&lt;input type='radio' name='category'&gt;&lt;a id='10214'&gt;New&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class='treeNodeInner'&gt;&lt;input type='radio' name='category'&gt;&lt;a id='10413'&gt;Email and Messaging&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class='treeNodeInner'&gt;&lt;input type='radio' name='category'&gt;&lt;a id='10414'&gt;Finance&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class='treeNodeInner'&gt;&lt;input type='radio' name='category'&gt;&lt;a id='10415'&gt;Mobile Office&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class='treeNodeInner'&gt;&lt;input type='radio' name='category'&gt;&lt;a id='10416'&gt;Sales and Field Force&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class='treeNodeInner'&gt;&lt;input type='radio' name='category'&gt;&lt;a id='10417'&gt;Calculators  Converters&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class='treeNodeInner'&gt;&lt;input type='radio' name='category'&gt;&lt;a id='10418'&gt;Travel  Transportation&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class='treeNodeInner'&gt;&lt;input type='radio' name='category'&gt;&lt;a id='10419'&gt;Reference&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;a class='expand'&gt;&lt;/a&gt;&lt;span class='treeNodeInner'&gt;&lt;input type='radio' name='category'&gt;&lt;a id='10962'&gt;asdasd&lt;/a&gt;&lt;ul&gt;&lt;li&gt;&lt;a class='expand'&gt;&lt;/a&gt;&lt;span class='treeNodeInner'&gt;&lt;input type='radio' name='category'&gt;&lt;a id='10964'&gt;asd&lt;/a&gt;&lt;ul&gt;&lt;li&gt;&lt;span class='treeNodeInner'&gt;&lt;input type='radio' name='category'&gt;&lt;a id='10420'&gt;Backup  Optimization&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class='treeNodeInner'&gt;&lt;input type='radio' name='category'&gt;&lt;a id='10974'&gt;test_23March&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;
  </code></pre>
  
  <p>thanks</p>