In previous game, we have leant some new properties of HTML 5.
In this version, we learn some new function in javascript below:
- to generate a random number from 1 to 100: Math.floor(Math.random() * 100);
- to catch the event keydown in all over the site: window.addEventListener("keydown", keydownHandler, false);
- to remove event Handler when we don't want that element (ex: button) catch an event: button.removeEventListener("click", clickHandler, false);
Example:
[Read More...]
In this version, we learn some new function in javascript below:
- to generate a random number from 1 to 100: Math.floor(Math.random() * 100);
- to catch the event keydown in all over the site: window.addEventListener("keydown", keydownHandler, false);
- to remove event Handler when we don't want that element (ex: button) catch an event: button.removeEventListener("click", clickHandler, false);
Example:
I am thinking of a number between 0 and 99.