代码如下:
New Document function isreadonly(){
var obj = document.getElementById("username");
obj.setAttribute("readOnly",true);
obj.style.backgroundColor="#d2d2d2";
}
function readwrite(){
var obj = document.getElementById("username");
obj.setAttribute("readOnly",false);
obj.style.backgroundColor="#ffffff";
}
script>
点击“read”按钮,input框不能书写,且变灰;点击“write”按钮,input框恢复。
-->