add readonly attribute jquery

JavaScript
$(input).attr('readonly', true);
Source

Also in JavaScript: