WDV221 Intro Javascript

Comparisons and IF Statements - Compare Numbers Assignment


Please complete the following exercises on this page. When complete post this page to your server. Make a link in your WDV221 homework page for this assignment.

Include a comment in each script with the exercise number and a description of what the script is supposed to do.

Using Blackboard submit this Assignment.


Value 1:

Value 2:

Result:

Instructions:

  1. Create a function called compareNumbers( ).
  2. The function will compare two numbers entered in the form above.
  3. The function should display the largest number or "Equal" if both values are the same.
  4. The results will be displayed in a span element using the .innerHTML property.
  5. Provide a reset function that will properly clear the form between attempts.