I am trying to change the background color of a label in each checkbox in a form based on the checked/unchecked state of the checkbox.So far I got it to change initially, but it
Your are not setting the color on the label but on the checkbox. jQuery makes it easy for you to select / traverse DOM elements (and also helps clean-up a lot of unnecessary IDs), see this fiddle :
http://jsfiddle.net/7wnCL/17/
$('input[type=checkbox]').change(function(){
if($(this).prop('checked')){
$(this).parent().css('backgroundColor', '#bff0a1');
}else{
$(this).parent().css('backgroundColor', '#eee');
}
});