Closed malrese1 closed 7 years ago
It looks like you're using jQuery for the first bit and then vanilla JS to set the background color.
I would stick with one or the other, then in the first line of checkAnswer use either $(selector)
or document.querySelector(selector)
to target the card and assign the result to a variable (eg card
). Then console.log(card)
and make sure you have the right element targeted.
Card not changing color when i answer a question
//What happens If the answer is right or wrong function checkAnswer() { console.log(); event.preventDefault(); var userGuess = $(this).siblings().find('input[type=text]').val()
}