当满足 if 语句要求时,不会显示我的显示中奖消息
//start check function
function check(){
if(box1 >= 1 && box1 <= 6 && box2 >= 1 && box2 <= 6 && box3 >= 1 && box3 <= 6)
{
//display wining message
document.getElementById('header').textContent = 'Congrats! You win 1 credit.';
//add one credit when you get 3 reds
creditCounter = creditCounter + 1;
}
if(box1 >= 7 && box1 <= 9 && box2 >= 7 && box2 <= 9 && box3 >= 7 && box3 <= 9)
{
//display wining message
document.getElementById('header').textContent = 'Congrats! You win 10 credit.';
//add 10 credits when you get 3 green
creditCounter = creditCounter + 10;
}
if(box1 == 10 && box2 == 10 && box3 == 10)
{
//display wining message
document.getElementById('header').textContent = 'Congrats! You win 100 credit.';
//add 100 credits when you get 3 blue
creditCounter = creditCounter + 100;
}
else{
//display losing message
document.getElementById('header').textContent = 'Sorry, please try again.';
}
}//END check() function