So I recently asked a question on how to do this over at the other question I posted where I asked how to change some javascript to make it so that only if a particular check box was checked all check boxes would be disabled.
Well I wrote this:
$(function () {
$("#disable").change(function () {
$(this).siblings().attr("disabled", $(this).is(":checked"));
});
});
and over here on jsfiddle you’ll see that it doesn’t work. The idea is, if you check the first checkbox, all the rest should become disabled. How ever it doesn’t…..
what am I doing wrong?
you went wrong with the DOM. Check here: http://jsfiddle.net/83w8s/1/