Get the first li text with jquery in many li
<p>I have:</p>

<pre><code>&lt;li id="1"&gt;
     This is what I want to get
     &lt;li id="2"&gt;
         not needed to be selected
         &lt;li id = "3"&gt;
             not needed...
         &lt;/li&gt;
     &lt;/li&gt;
&lt;/li&gt;
</code></pre>

<p>I want to get the li with id = 1 text with jQuery, this is what I have:</p>

<pre><code>var id = "1"
var needed = $('li[id='+cat_id+']').text();
</code></pre>

<p>But this gets all the texts, how I could only get <code>This is what I want to get</code>.</p>

<p><strong>UPDATE</strong></p>

<p>You're right, that was wrong, so now it is:</p>

<pre><code>&lt;li id="1"&gt;
    This is needed
    &lt;ul&gt;
        &lt;li id = "2"&gt;Not needed&lt;/li&gt;
        &lt;li id = "3"&gt; Not needed too &lt;/li&gt;
    &lt;/ul&gt;
&lt;/li&gt;
</code></pre>

<p>in the above example how could I select <code>This is needed</code> considering it's id = "1"?</p>
