I'm currently working on enabling a button transition from .disabled = true to .disabled = false. My project involves creating a Yahtzee game clone for entertainment, where players need to select a score to keep after their third roll. Once that choice is made, the button should become unlocked allowing them to roll again. I attempted to achieve this but encountered crashes. My initial idea was to use a while statement to wait until a score is chosen. The variable ptsss keeps track of the number of scores entered.
if(rollcount == 3){
while (ptsss * 3 < rollcount){
document.getElementById("rollbutton").disabled = true;
if (ptsss * 3 == rollcount){
document.getElementById("rollbutton").disabled = false;
break;
}
}
}
}