CPSC 101B: Introduction to Computers

Spring 2003

JavaScript Homework 1

Due: Midnight, Tuesday, March 11, 2003.


  1. Write a page in HTML that contains a form. The form should contain two input boxes to allow the user to enter two numbers. The form should contain a button labelled "Add". When the user clicks the button, the form should display in another input box the result of adding the two numbers the user entered.
  2. Write a page in HTML that contains a form. The form should contain two input boxes to allow the user to enter two numbers. The first number the user enters is his/her score on a test. The second number the user enters is the maximum points on the test. The form should contain a button labelled "Compute Percentage". When the user clicks the button, the form should display in another input box the percentage score of the user in the test.

Move your pages to your W drive, and send me in email the URLs of the two pages.