Lab #5: Manipulating HTML and Form Validation

Now that we've learned about JavaScript, what can we use it for?

Some people use it to validate their forms to make sure people are entering in the required information. You can also use it to manipulate elements on the page.

Resources

JavaScript Objects - If you need to know how to access a Date Object... etc. Look here!

HTML Document Object Model

Problem 1

Add JavaScript so that you change the color of the text.

Problem 1 File

Problem 2

Add JavaScript so that when you click the button, the document writes, "The button has been clicked!"

Problem 2 File

Problem 3

Add JavaScript so that when you click the button, a new table row is inserted at the bottom of the table with some HTML content within it such as your name or some witty phrase.

Problem 3 File

Problem 4

Add JavaScript so that when you hover over and image with your mouse, it changes the image.

Hint: Make sure to change the image's height and width so that the new image won't be skewed.

Problem 4 File

Problem 5

Add JavaScript so that when a form is submitted, it checks to make sure the email is valid.

Hint: Needs to make sure that there is an "@" sign in it and that there is a "." somewhere after the "@".

Problem 5 File