1、js為<input>設置readOnly屬性
<textarea cols="27" rows="6"></textarea>
var cObj = document.getElementById("content");
cObj.setAttribute("readOnly",'true');
2、js移除<input>readOnly屬性
var cObj = document.getElementById("content");
cObj.removeAttribute("readOnly");
注意:一定要注意readOnly大小寫!!!
新聞熱點
疑難解答
圖片精選