else (yMonth == 12)
Should be:
else if (yMonth == 12)
And when you indent the code properly, it's easy to notice this error:
if (xYear == 2012 && yMonth == 10) {
stopIt = "Yes"
}
else (yMonth == 12) { // shoule be: else if (yMonth == 12) {
stopIt = "Yes"
}
Notes: javascript is case sensitive which means
Do
isn'tdo
- so as for
alert
instead ofAlert
new
instead ofNew
But semicolons are not mandatory, you can use them or use not, as you wish.
Update:
From looking at the full code you posted, man, it has lots of weird things.
for (j = 2009; j = 2012; j++)
Should be something like:
for (var j = 2009; j <= 2012; j++)
...
You define a variable:
var StopIt = "No"
But use stopIt
instead:
stopIt = "Yes"
You should take a javascript course\tutorial, it's not that difficult to learn, but your code in it's current state is totally broken!