Adriano• 33,970
@AdrianoEscarabote
Posted
Hello Joaotbb, how are you? I truly loved your project's outcome, however I have some advice that I hope you'll find useful:
To make the submit button work only when the user selects a number, we can make some changes:
// Run all buttons call the number clicked to variable
btns.forEach((btn) => {
btn.addEventListener('click', function (e) {
btnValue = btn.value
btnSubmmit.addEventListener('click', function (e) {
console.log(btnValue)
result.textContent = btnValue
mainCard.classList.add('hidden')
thanksCard.classList.remove('hidden')
})
})
})
The remainder is excellent.
I hope it's useful. 👍
0