WDV221 Intro Javascript

Project 6 Arrays

Lookup Tax Rate Form

This form will allow the user to select a state from a dropdown list. Once it is selected the tax rate for that state will be dislayed on the form.

Please select a state:

The Sales tax rate is:


  1. Use javascript to create the options in the drop down menu. Put the state name as in the drop down.
  2. The option elements will look like this <option>Iowa</option>
  3. Use the onchange event handler on the select element to run displayTaxRate( )
  4. Create a function called displayTaxRate( )
  5. The function will use a lookup loop to find where the state is located in the states array. It can then get the corresponding tax rate from the taxRate array.
  6. It will display the tax rate for the selected state.