using jquery to add readonly attribute code example Example: add readonly attribute jquery $(input).attr('readonly', true);