HTML.form.guide

auto-focus

Fixing the auto-focus

Focusing on an input element just as the user loads the form will easily be a great usability enhancement. However, doing it the wrong will cause problem for at least some users. Setting focus in onload() event Most websites make the mistake of setting the focus in the onload() event. This can cause troubles for the user. <body onload='document.myform.username.focus();' > Imagine a login form. The web page is being loaded and the login form appears.

Continue Reading →