Form Focus | JavaScriptSource

Form Focus

Lee Underwood Aug 20, 2008


This snippet places the cursor in a selected form field upon page load. It uses the ID attribute, making it easy to target any field, regardless of form changes. Easy to add to any form.



Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: formFocus.js


Paste this code into the HEAD section of your HTML document.


Paste this code into the BODY section of your HTML document

Leave a Response

(1 comment)

Hi,[br /][br /]I looked at many of these but this was the easiest and cleanest to use. Top hole old bean!

alastair Nov 27, 2008