jQuery not finding all expected anchor links in HTML
I'm using jQueryPad to try out a bit of JavaScript and I'm stuck. Given I have the following HTML snippet:

    <TABLE style="BORDER-COLLAPSE: collapse" id=phMain_Questions class=GridView border=1 rules=all cellSpacing=0><TBODY>
    <TR class=GridViewHeader>
    <TH scope=col>&nbsp;</TH>
    <TH scope=col>&nbsp;</TH></TR>
    <TR class=GridViewRow>
    <TD><A id=hlQuestionDetails href="javascript:AddQuestionWindow_Open(3, 39, 'False');">This is a test question</A> </TD>
    <TD><A href='javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$phMain$gvQuestions$ctl02$ctl00", "", true, "", "", false, true))'>Remove</A> </TD></TR>
    <TR class="GridViewRow GridViewRowAlt">
    <TD><A id=hlQuestionDetails href="javascript:AddQuestionWindow_Open(3, 40, 'False');">This is an option question.</A> </TD>
    <TD><A href='javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$phMain$gvQuestions$ctl03$ctl00", "", true, "", "", false, true))'>Remove</A> </TD></TR></TBODY></TABLE>

What I want is to pick out all the `a` tags whose `id` attribute is `hlQuestionDetails`. My stab at this is:

    var links = $("a#hlQuestionDetails");
    alert($(links).length);

The number of `a` tags found is 1, but as you can see in the HTML, there are in fact 2 `a` tags with that name.

Can someone point what I'm doing wrong here, as I can't figure out why jQuery is leaving one of the `a` tags out.

Cheers.
Jas.
jQuery not finding all expected anchor links in HTML
===

I'm using jQueryPad to try out a bit of JavaScript and I'm stuck. Given I have the following HTML snippet:

    <TABLE style="BORDER-COLLAPSE: collapse" id=phMain_Questions class=GridView border=1 rules=all cellSpacing=0><TBODY>
    <TR class=GridViewHeader>
    <TH scope=col>&nbsp;</TH>
    <TH scope=col>&nbsp;</TH></TR>
    <TR class=GridViewRow>
    <TD><A id=hlQuestionDetails href="javascript:AddQuestionWindow_Open(3, 39, 'False');">This is a test question</A> </TD>
    <TD><A href='javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$phMain$gvQuestions$ctl02$ctl00", "", true, "", "", false, true))'>Remove</A> </TD></TR>
    <TR class="GridViewRow GridViewRowAlt">
    <TD><A id=hlQuestionDetails href="javascript:AddQuestionWindow_Open(3, 40, 'False');">This is an option question.</A> </TD>
    <TD><A href='javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$phMain$gvQuestions$ctl03$ctl00", "", true, "", "", false, true))'>Remove</A> </TD></TR></TBODY></TABLE>

What I want is to pick out all the `a` tags whose `id` attribute is `hlQuestionDetails`. My stab at this is:

    var links = $("a#hlQuestionDetails");
    alert($(links).length);

The number of `a` tags found is 1, but as you can see in the HTML, there are in fact 2 `a` tags with that name.

Can someone point what I'm doing wrong here, as I can't figure out why jQuery is leaving one of the `a` tags out.

Cheers.
Jas.