Måske lidt omstændigt, men det virker!!
<!-- THREE STEPS TO INSTALL FORM FOCUS:
1. Copy the coding into the HEAD of your HTML document
2. Add the onLoad event handler into the BODY tag
3. Put the last coding into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Tom Khoury (twaks@yahoo.com) -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!!
http://javascript.internet.com -->
<!-- Begin
function placeFocus() {
if (document.forms.length > 0) {
var field = document.forms[0];
for (i = 0; i < field.length; i++) {
if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) {
document.forms[0].elements[i].focus();
break;
}
}
}
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Insert the onLoad event handler into your BODY tag -->
<BODY OnLoad="placeFocus()">
<!-- STEP THREE: Copy this code into the BODY of your HTML document -->
<form>
<input type=text size=10>
</form>
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by <a href="
http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
<!-- Script Size: 1.15 KB -->