My jquery looks like this
$('#content a[href*="Something"]')
and returns this
[<a href="Something1">blah</a>,
<a href="Something2">blah</a>,
<a href="Something3">blah</a>,
<a href="Something4">blah</a>]
I’m trying to use :first to get the first element.
$('#content a[href*="Something"]:first')
But it’s not working. The #content part seems to be causing a problem. How can I fix this without removing #content?
Edit: my html
<div id="content>
<a href="Something1">blah</a>
<a href="Something2">blah</a>
<a href="Something3">blah</a>
<a href="Something4">blah</a>
</div>
I’m not sure why
:firstisn’t working for you, it works for me in similar situations, but if nothing else works, try usingfilter()instead: