A dirty way to run js script inline and bring Focus to an element:
<html> <body> <form method="post" action="index.php" id="myForm"> <p> Login: <input type="text" name="pwd" id="pwd" /> </p> </form> <script type="text/javascript">document.myForm.pwd.focus();</script> </body> </html>
Notice that both the form and form element have an ID