"reneecccwest" <re**********@hotmail.com> wrote in message
news:c1*************************@posting.google.co m...
hello, is there any way to indicte a cursor on the first text user
input when a page loads without using onload in the body tag?
<html>
<head>
<title>focus.htm</title>
</head>
<body>
<form>
<input type="text" name="field1">
<input type="text" name="field2">
</form>
<script type="text/javascript">
document.forms[0].field1.focus();
</script>
</body>
</html>
Though, <body onload="document.forms[0].field1.focus()"> would be simpler.