Find nested children of li
<p>I know it is ugly, but I need to find out how to get the attribute of <code>&lt;a&gt;</code> tag, of each <code>&lt;li&gt;</code> that has a <code>&lt;span&gt;</code> with class <code>jqx-checkbox-check-checked</code>, if the <code>&lt;li&gt;</code> contains another set of <code>&lt;ul&gt;&lt;li&gt;</code>. Only direct <code>&lt;span&gt;</code> will be check for the desired class(<code>jqx-checkbox-check-checked</code>)</p>

<p>This is the code sample:</p>

<pre><code>&lt;li&gt;
    &lt;span&gt;&lt;/span&gt;
    &lt;div&gt;
        &lt;div&gt;
            &lt;div class="jqx-checkbox-default jqx-rc-all"&gt;
                &lt;span  class="jqx-checkbox-check-checked"&gt;&lt;/span&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;span class="jqx-rc-all jqxtree item"&gt;
        &lt;a href="5.1"&gt;&lt;b style="color:black"&gt; item1&lt;/b&gt;&lt;/a&gt;
    &lt;/span&gt;
    &lt;ul class="jqx-tree-dropdown" &gt;
        &lt;li &gt;
            &lt;span class="jqx-tree-item-arrow-collapse jqx-disableselect"&gt;&lt;/span&gt;
            &lt;div class="chkbox jqx-checkbox"&gt;
                &lt;div&gt;
                    &lt;div class="jqx-checkbox-default jqx-rc-all"&gt;
                        &lt;span  class="jqx-checkbox-check-checked"&gt;&lt;/span&gt; 
                    &lt;/div&gt;
                &lt;/div&gt;
            &lt;/div&gt;
            &lt;span class="jqx-rc-all jqx-tree-item"&gt;
                &lt;a href="5.1.1"&gt; item2 &lt;/a&gt;
            &lt;/span&gt;
        &lt;/li&gt;
        &lt;li &gt;
            &lt;span class="jqx-tree-item-arrow-collapse jqx-disableselect"&gt;&lt;/span&gt;
            &lt;div class=""&gt;&lt;div&gt;
            &lt;div class="jqx-checkbox-default jqx-rc-all" &gt;
                &lt;span class="jqx-checkbox-check-checked"&gt;&lt;/span&gt;
            &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
            &lt;span class="jqx-rc-all jqx-tree-item"&gt;
                &lt;a href="5.1.2"&gt;&lt;b style="color:black"&gt; item3&lt;/b&gt;&lt;/a&gt;
            &lt;/span&gt;
        &lt;/li&gt;
    &lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
</code></pre>

<p>I know it is not simple! but if someone can show me the right jquery approach,  I will be more then grateful </p>
