html - What is wrong with my javascript reference -
i'm trying make simon program, started random color generator. can find what's wrong this? thanks! html:
<!doctype html> <html> <body> <script src="memorygamejs.js"> </script> </body> </html> javascript:
var colornumber = math.random(); if (colornumber < '.26'){ colorchoice = "red"; } else if (colornumber < '.51'){ colorchoice = "yellow"; } else if (colornumber < '.76'){ colorchoice = "green"; } else{ colorchoice = "blue"; } } console.log(colorchoice);
you got }. remove it, works fine: http://jsfiddle.net/tymejv/g44da/
remember check console errors, have seen:
uncaught syntaxerror: unexpected token }
Comments
Post a Comment