<html>
<body>
<h1>The Element Object</h1>
<h2>The focus() Method</h2>
<p>The text field below gets focus immediately after the document window has been loaded.</p>
<input type="text" id="myText" value="A text field">
<script>
window.onload = function() {
document.getElementById("myText").focus();
}
</script>
</body>
</html>