codingtcher.com
Theme Night
Home
Login

Jquery set attribute readonly code example

//jquery set attribute readonly
// jQuery < 1.9
$('#id').attr('readonly', true);

// jQuery >= 1.9
$('#id').prop('readonly', true);

//add readonly attribute jquery
$('#inputId').attr('readonly', true);

Related Code