I have the following HTML code:
<div id="mycontainer">
<p> title </p>
<ul>
<li><span>**</span><a href="...">KEY</a></li>
</ul>
<ul>
...
</ul>
</div>
How would I get the KEY value? In other words, from this div with id = "mycontainer", how would I go to get from the first ul, the content of the element?
$("#mycontainer ul:first a").text();
here, have a fiddle: http://jsfiddle.net/8tvTt/
Something like this will achieve what you're after:
$("#mycontainer ul:first a").text();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With