<html>
<head>
<title>test</title>
<script language="JavaScript">
<!--
function init()
{
form1.userId.focus();
}
//-->
</script>
</head><body onload="javascript:init()">
<form name="form1" action="" method="post">
<input type="text" name="userId">
</form>
</body>
</html>
<head>
<title>test</title>
<script language="JavaScript">
<!--
function init()
{
form1.userId.focus();
}
//-->
</script>
</head><body onload="javascript:init()">
<form name="form1" action="" method="post">
<input type="text" name="userId">
</form>
</body>
</html>
<font face=Marlett>6</font><br>
<input type=text>
<input type=text>
<script>
function keyDown()
{
if(event.keyCode==13)
{
event.keyCode=9;
return true;
}
}
document.onkeydown=keyDown;
document.captureEvents(Event.KEYDOWN);
</script>
document.tt.bownam.focus();
return;
}
</script>
<form name="tt"....>
<input name="bownam" type="TEXT" maxlength="4" size="8">
<head>
<title>test</title>
<script language="JavaScript">
<!--
function window.onload(){
form1.userId.focus();
}
//-->
</script>
</head><body>
<form name="form1" action="" method="post">
<input type="text" name="userId">
</form>
</body>
</html>
inputId是你用户名文本框的id