WDV221 Intro Javascript

Unit -7 Comparison and IF Statements - Compare Names Assignment

Name 1:

Name 2:



  1. Create a function called compareNames( ).
  2. The function will compare the two input values from the form above.
  3. The comparison should be case insensitive.
  4. The results should display "Same" or "Different".
  5. Use a span element and its .innerHTML property to display the results.
  6. Provide a reset function that will reset the form and results.