can anyone please help me?i don't know why this script don't work in IE its working fine FF.here's my code

Code:
<body onLoad="document.myForm.getElementById(StudNo.focus());">
  <form method="POST" action="validate.php" name="myForm">
  <br><br><br><br>
  <table border="1" align="center" cellspacing="3" cellpadding="5" bordercolor="#DAA520">
  <tr>
  <td bgcolor="#90EE90">
<table border="0" cellpadding="1" cellspacing="1" align="center" width="400">
  <tr>
    <td align="center">Log In to Survey</td>
  </tr>
  <tr>
    <td align="center">Student Number:
    <input type="text" name="StudNo" id="StudNo" size="30"></td>
  </tr>
  <tr>
    <td align="center"><input type="submit" value="Log In"></td>
  </tr>
  <tr>
    <td align="center"><i>Don't have an account?</i> <a href="register.php">Click here</td>
  </tr>
</table>
</td>
  </tr>
  </table>
</form>

the IE results in an error that says StudNo is undefined, i don't why it is i declared it as an ID and its name so why? tnx in advance for anyone who can help me.