I have the following input:
How c
You can do this by simply marking it disabled
or enabled
. You can use this code to do this:
//for disable
$('#fieldName').prop('disabled', true);
//for enable
$('#fieldName').prop('disabled', false);
or
$('#fieldName').prop('readonly', true);
$('#fieldName').prop('readonly', false);
--- Its better to use prop instead of attr.