How can I add readonly to a specific <input>? .attr('readonly') does not work.
readonly
<input>
.attr('readonly')
jQuery <1.9
$('#inputId').attr('readonly', true);
jQuery 1.9+
$('#inputId').prop('readonly', true);
Read more about difference between prop and attr
1.4m articles
1.4m replys
5 comments
57.0k users