WDV221 Intro Javascript

Project-4 Comparisons and If Statements - Homework 4

Please complete the following exercises on this page. When complete post the page to your WDV221 folder on the server. Make a link in your WDV221 Intro Javascript page for this assignment. Contact your instructor and demonstrate that you have completed the assignment.

Using Blackboard complete the In Class Exercise Assignment. Download your Homework project and being working on it with your remaining time.

For each exercise use a comment line to put the Exercise number within the script. Also place a short description of what the script is doing.

Part I

1. Use a runtime script to define two global variables called value1 and value2. Give them an intial value of "".

2. Create a function called getValues( ). This function will call a prompt and allow the user to type in two values. The first value will be stored in the variable value1 and the second value will be stored in the value2 variable.

3. Create a button that will activate the getValues( ) function.

Click button to enter your values:

Click button to enter your values:

4. Place three textfields on this page. Label them as Value 1: and Value 2: and Results:




5. Place a reset button on this page that will clear the textfields. It will also call a function called clearVariables( ). The function will reset the global variables to "".

Part II

Create a function for each of the following buttons. The function will call the getValues( ) and display the appropriate value in the results field.