document.getElementsByName returns elements more than expected
- by Homer
I have a RadioButtonList
<asp:radiobuttonlist runat="server" id="rblList">
<asp:listitem>s1</asp:listitem>
<asp:listitem>s2</asp:listitem>
<asp:listitem>s3</asp:listitem>
<asp:listitem>s4</asp:listitem>
</asp:radiobuttonlist>
In my client code I'm grabbing the array of radio buttons like this
var elements = document.getElementsByName("rblList");
Why am I getting 5 items instead of 4? It makes elements like a 1 based array.