i've building a nodejs app and using jquery in it. I try to get the text from a anchor from an nested list:
<ul class="someClass">
<li>
<a href="/blabla">Anchor Content</a>
</li>
</ul>
My JQuery Code to get the content is:
$('#someClass').find('a').text();
Unfortunately it isn't working. Any ideas?
Use this
$('.someClass').find('a').text();
Use the class selector. Until now, you're just using the ID selector. In jQuery . is the class selector. In HTML you're using the class not the ID. So that code won't work.
For more on jQuery selectors: http://api.jquery.com/category/selectors/