'jQuery - changing div background-color depending on answer

I want to change background-color according to answer I hide the correct answer in the label inside the page.

 <label id="correctanswer" name="1" class="rb" style="display:none;">Tom</label>
 <label id="correctanswer" name="1" class="rb" style="display:none;">Liza</label>

I have 2 questions in the code (please check the jsfiddle)

I want to change the background color of the answers after the user clicks the "Submit" button after marking the relevant answer.

But even if the user chooses the correct answer, the background color get red.

Also, I don't want it to look like this.

Only the background of the answer chosen by the user should be green or red, other colors should not change.

I want it to look like this.

Please check the codes;

http://jsfiddle.net/p9vgcuae/2/



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source