Adding class to two different elements at the same time

I’m building a quiz app in which the correct option shows green background and the wrong asnwer gets a red backgroung. i created a className of correct with a green background and wrong with a red background in my css sheet this classes are added when the user click on an option thereby changing background color of the option selected. now i want the correct option to get a green background and the wrong option a red backgroung simultaneously when the user selects a wrong option. My if statement is below:

if(id[id.length-1]==this.questions[this.index].answer) {

    } else {

Could you put this into codepen and share it here? It might be easier for us to see what is happening.

ok. here is the codepen link