make input not editable for user js 1

make input not editable for user js

document.getElementById('TextBoxID').readOnly = true;    //to enable readonly


document.getElementById('TextBoxID').readOnly = false;   //to  disable readonly

Here is what the above code is Doing:
1. First, we are getting the element by its ID.
2. Then, we are setting the readOnly property to true.
3. Finally, we are setting the readOnly property to false.

Similar Posts