tmoflash 0 Report post Posted March 21 (edited) In the Javascript language everything is case sensitive and also camel case must also be used. why is "onclick" not using camel case? The other thing I do not understand is reading from top to bottom. I understand that the browser reads JS from top to bottom and if an item is declared after the JS script it will not be recognized. However, in this piece of code why did it skip over end not trigger. My guess is when the browser read the script and put into memory it knew that it was false based on the Boolean value? if(notRunning) { animation = setInterval(discoSquare, 100); notRunning = false; } else { alert("Sorry, already running.") } Edited March 21 by tmoflash Share this post Link to post Share on other sites
administrator 80 Report post Posted March 21 1 hour ago, tmoflash said: why is "onclick" not using camel case? Because the developer decided to make it that way. Not all things are obviously logical. And sometimes they are not logical at all! The key to the conditional you listed above, is the value held in the variable 'notRunning' .... it did not trigger because 'notRunning' held a value of false. Stef Share this post Link to post Share on other sites