搞定document.all.objectName.disabled=true

解决方案 »

  1.   

    来晚了:)
    还有一种方式,如果不知道名字的话可以用
    document.formname.elements[i].disabled=true
      

  2.   

    例如:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    </head><body><form action="" method="post" name="myform" id="myform">
      <input name="mytf" type="text" id="mytf" value="Click Change it">
    </form><a href="#" onClick="document.all.mytf.disabled=true;">Change it</a></body>
    </html>