<input  id=d  name=q>

解决方案 »

  1.   

    <td javascript:this.focus()></td>
      

  2.   

    <body onload='document.getElementById("d").focus();'>
      

  3.   

         var objList = document.getElementsByTagName("input");
         for ( var i = 0 ; i< objList.length ; i++ ) 
         {
             if ( objList[i].type == "text" ||  objList[i].type == "textarea" || objList[i].type == "password"  ) 
             {
                 if ( objList[i].disabled != true ) 
                 {
                     objList[i].focus();
                     return false;
                 } 
             }
         }
      

  4.   

         var objList = document.getElementsByTagName("input");
         for ( var i = 0 ; i< objList.length ; i++ ) 
         {
             if ( objList[i].type == "text" ||  objList[i].type == "textarea" || objList[i].type == "password"  ) 
             {
                 if ( objList[i].disabled != true ) 
                 {
                     objList[i].focus();
                     return false;
                 } 
             }
         }