WDV221 Intro Javascript

Lab Exam #1

Discount Selector:

Please select your discount rate:

Character Counter:

Your information has characters.

Add Numbers:

Exam Instructions:

  1. Create a global scope variable called yourName. Assign your name to the variable.
  2. Write a function that will display the variable yourName as an h2 element in the bottom of the header. Call this function as a runtime function.
  3. Discount Selector:
    1. When a discount has been selected call the displayDiscount function that is already on the page. It should not need to be modified.
    2. Pass the appropriate information as a parameter for the display message.
  4. Character Counter
    1. When the "Count Characters" button is clicked call a function.
    2. The function will pull the information from the text field and count the number of characters in the field.
    3. Display the result inside the characterCount span.
  5. Add Numbers
    1. When the Add Numbers button is clicked call the addValues( ) function.
    2. The function will pull the values from Number 1 and Number 2.
    3. The function will add them together.
    4. Display the result in the Result text field.
    5. If the result is greater than 100 display the following message "That is to much for you!" else display "Good choice!" at the end of the Result line.

Extra Credit: