window.onload=function(){
contents = new Array();
painted = new Array();
keys = 0;
for(var i = 0; i < 4; i++){
contents[i] = '';
painted[i] = false;
}
contents[0] = 1;
}
function clicked(canvasNumber){
if(contents[canvasNumber-1] == 1;){
alert("you won!");
}
}
I am trying to get a pop up saying, "you won!" when canvas 1 is clicked, but the contents of my contents array are not matching up to trigger that alert. What am I doing wrong?
clicked?contentsoutside the functions to make it a global?