How can I use jQuery to make an input readonly?
jquery
Solution
These days with jQuery 1.6.1 or above it is recommended that .prop() be used when setting boolean attributes/properties.
$("#fieldName").prop("readonly", true);
Problem
I have the following input: ``` <input id="fieldName" name="fieldName" type="text" class="text_box" value="Firstname"/> ``` How can I use jQuery to make this element a read-only input without changing the element or its value?