$input.disabled = true;
or
$input.disabled = \"disabled\";
Which is the standard way? And, conversely, how do yo
I used @gnarf answer and added it as function
$.fn.disabled = function (isDisabled) { if (isDisabled) { this.attr('disabled', 'disabled'); } else { this.removeAttr('disabled'); } };
Then use like this
$('#myElement').disable(true);