Sharpening skills at the Shard
We worked on a series of exercises, starting with JS first and then progressing to JQ on the final day.
Guess the number
The first exercise was a ‘guess the number’ game. We had to build a web application that selected a random number from 1-100. The user would input number into a field and the web application would say whether that was higher or lower than the random number. Through a process of elimination the user could guess the correct number. The application would then tell the user how many attempts it took them to reach the correct answer.
The second exercise was to build a noughts and crosses game. Essentially, this was an interactive game for two people. The first player was ‘x‘ and the second ‘o’. When a user clicked on a section of the 3x3 grid, it would place their symbol. If they were able to connect three symbols in a row they won the game.
The third exercise was to add interactive rollover states to an image. We did this twice, once with JS and the second time with JQ, allowing us to see the differences between the two
JQuery form validation
The final exercise was to create a form with form validation. This was extremely useful. The JQuery checks as you type in field to make sure you are inputting the correct details. For example, if your password and password confirmation do not match, it will tell you straight away, rather than waiting for you to submit the form.