JavaScript

Monday April 7, 2025
updated: April 10, 2002

 
Home
Getting Started
Lesson 1
Lesson 2
Lesson 3
Lesson 4
Lesson 5
Lesson 6
Lesson 7
Lesson 8
Resources
Credits

 

 


Assignment 4

Create a web page containing JavaScript that will do the following:

1. When the user enters the page the following alert message appears: "Hello welcome to my web site!"

2. Display 4 buttons of 4 different colors along the top of the web page.

3. Write a script so that the color of the button is displayed in the status bar when the mouse rolls over the button.

4. Write a Script so that when each button is clicked a new document is written. The background colour of the document should correspond with the color of the button. The text of the document should be the colour of the button which was clicked. For example, if a red button was clicked a new document should open which has a red background and the text "RED" should be written to the document.

5. Create an appropriate title for the web page.

6. Create instructions that appear below the 4 buttons, instructing the user to click on a button.

7. Include your name on the web page.

8. Save as A4YourName.


© 2002 Tracy Johnson