need get link text from selected li menu with jquery
<p>when i click on my li menu, i need get this link text. The problem is that the menu is a tree and i get a current text with parent text.</p>

<p>For example - when i clik on "test 3" i also get and "test 2". In this situation i need get only "test 3".</p>

<p>I can change only jquery script, html code generate cms.</p>

<p>My code:</p>

<pre><code>&lt;script&gt;
$(document).ready(function(){
    $("#menu li").click(function() {
        var text = $(this).children('a').text();
        alert(text);        
    });
});
&lt;/script&gt;
&lt;div id="menu"&gt;
        &lt;ul&gt;
            &lt;li&gt;&lt;a href="#"&gt;test 1&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;
                &lt;a href="#"&gt;test 2&lt;/a&gt;
                &lt;ul class="sub_menu"&gt;
                    &lt;li&gt;&lt;a href="#"&gt;test 3&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="#"&gt;test 4&lt;/a&gt;&lt;/li&gt;
                &lt;/ul&gt;
            &lt;/li&gt;
            ....
        &lt;/ul&gt;
    &lt;/div&gt;
</code></pre>
