Extract content of span inside the first matched link
Hi,
I have this piece of html duplicated in the document.
-
<a class="label application-label" href="/label/bp/app10411" rel="tag">
<span>app10411</span>
<span class="remove" title="Remove"></span>
</a>
I need to extract the content of the first span inside the link, the "app10411" string. I have tried
- $(".label.application-label span:first").html()
- $(".label.application-label").find("span").html()
- $(".label.application-label").first().find("span").html()
in the selector I have used ".label.application-label" , ".label .application-label" and ".application-label"
and other variants with no luck, always getting "null"
What am I missing? Thanks a lot.