Javascript Assignment 2

First: Read chapter 3 in the book

Create a form that takes information about a person:

  • Name
  • Favorite band
  • Favorite book
  • Age

Processing the Form

Write results (the output) into an HTML <div> on the page.  Style the results div so it's set off with either a different color or border from the other page elements.

Demonstrate that you can show different results based on their inputs.  Use your creativity.  You might show different result messages or even different images based on the user's input.   Show that you can use 3-4 different conditional operators.

Other Tasks

Demonstrate a nested if-then statement.  (You might incorporate this into the form processing above).
Demonstrate a switch-case statement.

Writing a Loop

Create a form that asks: "How many times should my loop run?" (takes numeric input). Write a loop that outputs a statement for the number of times they specify.