jQuery: Find the text of a list item that contains a nested ul
- by ScottE
I have the following:
<ul id="list">
<li>item1
<ul>
<li>sub1</li>
<li>sub2</li>
</ul>
</li>
</ul>
I'd like to respond to a li click event and use the text of the li elsewhere. However, if the click is on an li that contains a nested ul, I of course get the text of…