javascript - How to focus on a form input text field on page load using jQuery? -


This is probably very easy, but can someone tell me how the cursor is shining on a text box on page load ?

Set focus on the first text field:

  $ (" Input: text: appear: first ") focus ();  

This also does the first text field, but you can convert [0] to another index:

  $ ('input [@ type = "Text"] ') [0] .focus (); Or, you can use the ID:  
  $ ("# someTextBox"). Focus ();  

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -