<p id="abc_0" name="me"> Me </p>
<p id="abc_0" name="me2"> Me2 </p>
Here, there are 2 identical ids.
var ids=$("#abc_0").attr("name"); //returns Me.
This will return the first occurrence, which is what i want.
How do i do this with a regex, eg, /abc/
Something like : var ids=$('#'+/abc/).attr("name"); This doesn't work though.
The regex should match abc_0, but and the jquery id should return only the first match.