JS – Focus on Load

You can put the user’s cursor inside a text box (calling the text box’ focus) as soon as the page is loaded.

<html>
<head>

</head>
<body OnLoad="document.nameform.user.focus();">

<form name="nameform">
Name:  <input type=text name=user size=10>
</form>

</body>
</html>

Notice the tag body:

<body OnLoad="document.nameform.user.focus();">

My official WebSite >