Dear all I am using JQuery My list has following
<div id="wrapper">
<ul id="testnav">
<li class="test1"><a href="/link">Heading</a>
<ul>
<li><a href="/link">Sub Heading</a></li>
<li><a href="/link">Sub Heading</a></li>
<li><a href="/link">Sub Heading</a></li>
</ul>
</li>
<li class="test2"><a href="/link">Heading</a>
<ul>
<li><a href="/link">Sub Heading</a></li>
<li><a href="/link">Sub Heading</a></li>
<li><a href="/link">Sub Heading</a></li>
</ul>
</li>
<li class="test3"><a href="/link">Heading</a>
<ul>
<li><a href="/link">Sub Heading</a></li>
<li><a href="/link">Sub Heading</a></li>
<li><a href="/link">Sub Heading</a></li>
</ul>
</li>
</ul>
</div>
When i click the heading or sub Heading I need that corresponding text I used the following it not working
$("li").bind("click", function(){
alert( $(this).text());
});
What change should I make?