I have a form with many radio buttons and each radio button values are the same...
Question 1
Options Yes, No, N/A
Question 2
Options Yes, No, N/A
etc.
I would like to change the color of the label background for each question independently...
This is what I have:
$(document).ready(function() {
$('#q5').on('click', function(e) {
if (e.target.value == 'Yes') {
$('#q5 span label').css('background-color', '#58F952');
}
else if (e.target.value == 'No') {
$('#q5 span label').css('background-color', '#FB5944');
}
else if (e.target.value == 'N/A') {
$('#q5 span label').css('background-color', '#44AEFB');
}
});
});
How do I write this with the "this" statement so it only works for every radio button that I have set with css class .radio?