tangway / flag-guessing-game-frontend

0 stars 0 forks source link

disable choice buttons when attempts are finished or answer is correct or when it has been clicked #32

Open tangway opened 4 months ago

tangway commented 4 months ago

added disabled={(numberOfAttempts === 4 || correct) ? true : false} to the button attribute for when attempts are finished or when answer is correct

tangway commented 4 months ago

added this to the checkAnswer function to disable the button which user clicked so it can't be selected again

const target = event.currentTarget;
target.disabled = true;