One solution with direct CSS attribute:
$(":checkbox").on("change", function() {
var that = this;
$(this).parent().css("background-color", function() {
return that.checked ? "#ff0000" : "";
});
});
DEMO: http://jsfiddle.net/YQD7c/
Another solution using toggleClass:
$(":checkbox").on("change", function() {
$(this).parent().toggleClass("checked", this.checked);
});
Where you define the class checkedin CSS as follows:
.checked {
background-color: #ff0000;
}
DEMO: http://jsfiddle.net/YQD7c/1/