I have one line of javascript code that firefox only wont run. I have searched through stackoverflow, mozilla etc...all point to javascript being enabled but it is enabled and all script except one line wont run. It is within an if statement - one statement executes in the 'if' statement and the other doesnt. No answers anywhere on topic
this is my code:
/*figuring out how to fill in cell values using js*/
//need to set i counter according to which day is the 1st of the month
var i; //loop counter - correlates to <td> array
switch(firstId) {
case 1 :
i = 0;
break;
case 2 :
i = 1;
break;
case 3 :
i = 2;
break;
case 4 :
i = 3;
break;
case 5 :
i = 4;
break;
case 6 :
i = 5;
break;
case 7 :
i = 6;
break;
}
var add = i;
var subt = i - 1;
var x = document.getElementsByClassName("jan");
for(i; i < count + add; i++) {
x[i].style.backgroundColor = "#dadfe7";
x[i].innerText = (i - subt);
}
Firefox wont run this line
x[i].innerText = (i - subt);
the last line in the if
statement
but Chrome and Safari do.
No errors are thrown that I can see in chrome or firefox inspectors.
I would greatly appreciate any help. You can see the results by going to http://sunsetprayers.com/
It is a 2016 Calendar - I am learning javascript and want to have the months load in the correct squares using javascript code.
Any help is greatly appreciated!! ~jeanie