Homework 1

  1. Using the <script> tag within the body of an HTML page, use the document.write() function to print the text "Hello World!" (without the quotes) into your page.
  2. Create an HTML document with a form that has two fields - one for first name and one for last name. Add a button so when someone clicks the button, you show an alert that says, “Hello, Jen Golbeck” (where “Jen” is replaced with the text in the First Name field and “Golbeck" is replaced by the text in the last name field.)
  3. Here’s a tic tac toe board HTML file. Create 9 variables, one for each square. Add a button so, when someone clicks it, the values in each of the board squares get stored in the appropriate variable. Add an alert to show the value of the variable that represents the center square.