<html>
<head>
<title>Untitled Document</title>
</head>
<body bgcolor="#FFFFFF">
<form action="name_find.asp" method=post>
  <table >
    <tr > 
      <td> 
        <div align="center"><font color="#FF3333"><b></b></font></div>
      </td>
    </tr>
    <tr> 
      <td height="156">
     <input type="text"  name="myname" style="height:40px;font-size:20pt;color:#0000ff" size="50" maxlenth="30">
        
      </td>
    </tr>
  </table>
</form>
<script>
  document.all('myname').focus();
</script>
</body>
</html>

解决方案 »

  1.   

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

  2.   

    up
    <body onload="document.forms[0].myname.focus()">
      

  3.   

    <body onload=getFocus()>
    <script>
    function getFocus(){
    textName.focus();}</script>
      

  4.   

    <body onload="form.text.focus()">
      

  5.   

    up
    <body onload="document.forms[0].myname.focus()">
      

  6.   

    楼上的都对啊不过我更喜欢写成函数<script language="javascript">
    function text_focus()
    {
       document.forms[0].myname.focus();
    }
    </script><body onload="text_focus()">