make div editable or read only using conditions javascript code example
Example: javascript set readonly property
document.getElementById('InputFieldID').readOnly = true;
document.getElementById('InputFieldID').readOnly = true;