onload moving cursor (focus) on first field of form

B

binnyva

The easier version...

<body onload="document.forms[0].elements[0].focus();">

Or the better version...

<script language="javascript" type="text/javascript">
function loadFocus() {
document.forms[0].elements[0].focus();
}
window.onload = loadFocus;
</script>

Both will give the focus to the first field in the first form.

Binny V A
http://binnyva.blogspot.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top