set cursor in text box when page loads

I have a simple form that requests username and password. I want the cursor to already be in the username field when they go to the webpage so they can simply start typing without clicking on the text box. How can I do this?<br />
<br />
Thanks,<br />
Eric<!--content-->Please look at the following example:<br />
<br />
<html> <br />
<head> <br />
<title>Placing Focus</title> <br />
<script language="javascript" type="text/javascript"><br />
function placefocus()<br />
{<br />
document.myform.test.focus();<br />
}<br />
</script> <br />
</head> <br />
<body onLoad="placefocus();"> <br />
<form name="myform"> <br />
<p><input type="text" name="test"><br />
</form> <br />
</body> <br />
</html><!--content-->
 
Back
Top