Jquery disable element on checkbox change-Collection of common programming errors
Working demo http://jsfiddle.net/2gbHQ/5/
Good Read http://api.jquery.com/prop/
The .prop() method gets the property value for only the first element in the matched set. It returns undefined for the value of a property that has not been set, or if the matched set has no elements. To get the value for each element individually, use a looping construct such as jQuery’s .each() or .map() method.
Jquery code
$('#dw').change(function() {
if ($(this).is(':checked')) {
$('#oo').prop('disabled', false);
} else {
$('#oo').prop('disabled', true);
}
});
HTML
a
b
c
Originally posted 2013-11-09 19:09:41.