Hi,
You do not need to write the any kind of JavaScript funcation for that.
You can use the "TabIndex" property of the control.
You can set the sequence for the controls using this TanIndex property.
Please refer the below sample code for the same, it may help you:
<asp:TextBox runat="server" ID="TxtName" TabIndex="0" ></asp:TextBox>
<br />
<br />
<a id="anchor" tabindex="1" href="http://www.codeproject.com/">Test Anchor Tag</a>
<br />
<br />
<asp:Button runat="server" TabIndex="2" ID="BtnSubmit" Text="Submit"/>
Thanks ..
From,
Dhiraj Luhana