1. js sets the readOnly attribute for
var cObj = document.getElementById("content");
cObj.setAttribute("readOnly",'true');
2. js removes readOnly attribute
var cObj = document.getElementById("content");
cObj.removeAttribute("readOnly");
Note: Be sure to pay attention to the capitalization of readOnly! ! !