Why doesn't it work? I am trying now for a long time and there seem to be no end to it. Need to make it simple as possible
var firstInput = document.luckForm.numberBox.value;
var secondInput = document.luckForm.numberBox2.value;
var thirdInput = document.luckForm.numberBox3.value;
for (firstInput = 0; firstInput <= 10; firstInput++) {
if (firstInput = luckyNumber) {
if (secondInput = luckyNumber2) {
if (thirdInput = luckyNumber3) {
{alert('Congratulations! You got all 3 numbers correct. You\'ve won £1000!'); }}}}}
I was trying to change this code (see below) into a for loop code, very simple with no arrays. I am not sure how I can do this. It is supposed to be for a lottery, you can type in three numbers and if they are correct you would get the message that you win 1000 pounds.
if (firstInput == luckyNumber && secondInput == luckyNumber2 && thirdInput == luckyNumber3 || firstInput == luckyNumber && secondInput == luckyNumber3 && thirdInput == luckyNumber2 || firstInput == luckyNumber2 && secondInput == luckyNumber3 && thirdInput == luckyNumber || firstInput == luckyNumber2 && secondInput == luckyNumber && thirdInput == luckyNumber3 || firstInput == luckyNumber3 && secondInput == luckyNumber && thirdInput == luckyNumber2 || firstInput == luckyNumber3 && secondInput == luckyNumber2 && thirdInput == luckyNumber)
{
alert('Congratulations! You got all 3 numbers correct. You\'ve won £1000!');