By the end of these exercises you should be able to understand the following concepts:
- Declaring new functions and the concept of functions in general
- Responding to user input from the DOM
- Modifing the DOM
Start here if the material in the lecture was confusing or you want to brushup on your skills.
- Form validation is one of the first uses and bread and butter of javascript. Create a login form with password fields to:
- Validate that every field is filled out.
- Compare password and password confirmation.
- Validate the password is at least 8 characters.
- Tell the user when there is a problem with the form.
- Tell the user when they've successfully signed up.
(Note, most of this can be done with HTML 5 now, don't use this yet as it would circumvent the need to use javascript at all, and that's the point silly.)
-
Kitchen sink, demonstrate your html selection skills and go through the following exercises:
- Push the button and alert the user of the value they entered
- Add the numbers from the two boxes together, then alert the user of the value.
- Update the text block with the selected value from the drop-down.
-
Create a basic two-input calculator with the following functions:
- Addition
- Subtraction
- Multiplication
- Division
- Reset
- Clear last input