I have a code in asp.net:

<body>
   <form id="form1" runat="server">
   <div id="container">
       <div id="login">
           <div class="window">
               <table>
                   <tr>
                       <td>
                           Login:
                       </td>
                       <td>
                           <asp:TextBox ID="tbLogin" runat="server"></
asp:TextBox>
                           <asp:RequiredFieldValidator ID="rfvLogin"
runat="server"
                               ControlToValidate="tbLogin"
ErrorMessage="Musisz podać login"></asp:RequiredFieldValidator>
                       </td>
                   </tr>
etc.

I'm using firebug, and now I want to set focus on tbLogin. When I open
it on the server and I write $('input#tbLogin').focus();
I have a error:
>>> $('input#tbLogin').focus();
TypeError: $("input#tbLogin") is undefined login.aspx (line 65)

but when I save a generated html and open this saved file, it works
fine.
>>> $('input#tbLogin').focus();
Object length=1

Where I made a mistake?

Reply via email to