时间:2021-07-01 10:21:17 帮助过:40人阅读
var cObj = document.getElementById("content");
cObj.setAttribute("readOnly",'true');
2、js移除readOnly属性
var cObj = document.getElementById("content");
cObj.removeAttribute("readOnly");
注意:一定要注意readOnly大小写!!!