javascript change text field to readonly code example Example: javascript set readonly property document.getElementById('InputFieldID').readOnly = true;