How can I add readonly to a specific <input> ?(如何将readonly添加到特定的<input> ?)
readonly
<input>
.attr('readonly')
jQuery <1.9(jQuery <1.9)
$('#inputId').attr('readonly', true);
jQuery 1.9+(jQuery 1.9+)
$('#inputId').prop('readonly', true);
Read more about difference between prop and attr(阅读有关prop和attr之间差异的更多信息)
1.4m articles
1.4m replys
5 comments
57.0k users