Acknowledging the fact that the asker specifically requested jQuery and that the answer selected is correct, it should be noted that this problem doesn't actually need jQuery per say. If one desires to solve this problem without it, one can simply set the onClick
attribute of the checkboxes that he or she wants to add additional functionality to, like so:
HTML:
javascript:
function cbChanged(checkboxElem) {
if (checkboxElem.checked) {
// Do something special
} else {
// Do something else
}
}
Fiddle: http://jsfiddle.net/Y9f66/1/