jQuery 1.6+
To change the disabled
property you should use the .prop()
function.
$("input").prop('disabled', true); $("input").prop('disabled', false);
jQuery 1.5 and below
The .prop()
function doesn't exist, but .attr()
does similar:
Set the disabled attribute.
$("input").attr('disabled','disabled');
To enable again
$("input").removeAttr('disabled');
Read full article from How to disable/enable an input with jQuery? - Stack Overflow
No comments:
Post a Comment