How to compare quiz app answer with the correct answer?

I’m making a quiz app and I’m at the step where I need to compare after every answer if that answer is correct or not. If the answer is correct or not I want to add a class to a pin (a div with a background colored grey) to change it’s background(red or green, depending on the answer). I have a pin for every question and 10 question totally.