I've put some jQuery together to change the highlighting on a container (default red, black on check) when a specific checkbox is checked. I feel this code could be simplified, but not sure how. Does anyone have any ideas please?
$("#container input:checkbox[id=cbTermsAndConditions]").change(function() {
if ($(this).attr("checked")) {
$('#container').addClass("containerblack");
$('#container').removeClass("containerred");
} else {
$(this).parent().addClass("containerred");
$(this).parent().removeClass("containerblack");
}
});
Thanks