<html> <script> function ee() { document.getElementById("MyID").readOnly=false;//-->正确 // document.myform.ff.readonly=false; ---->错误 } </script> <body> <form name="myform"> <input id="MyID" type="text" name="mytext" value="" readonly> <input type="button" value="mybutton" οnclick="ee()"> </form> </body> </html>