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

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -