<input type="button" value="禁用文本框" id="btn"/> <input type="text" value="" id="txt"/> <script src="common.js"></script> <script> //点击按钮禁用这个文本框 document.getElementById("btn").onclick = function () { document.getElementById("txt").disabled = true; }; </script>