how to add an read only attribute in javascript code example Example: javascript set readonly property document.getElementById('InputFieldID').readOnly = true;