Estava analisando seu codigo e aparentimente achei a solução. <html> <title>TESTE DO SETFOCUS</title> <head> <script type="text/javascript"> function setFocus() { document.getElementById('nome').focus() OU document.form.nome.focus() } </script> </head> <body onLoad="javascript:setFocus();"> <h1>TESTE DO SET FOCUS</h1><br> <input type="text" id="nome" name="login"> <br> <input type="text" id="senha" name="password"> </body> </html>