Choose a Region by Country
Write the code, see it run, pass the checks.
The problem
- medium
- Code
An address form has two drop-downs (select elements) labelled "Country" and "Region". Country starts on "Choose a country", followed by "Canada" and "Australia". Region is disabled until a country is chosen. Then it offers "Choose a region" followed by that country's regions, in this order: Ontario, Quebec and British Columbia for Canada; New South Wales, Victoria and Queensland for Australia. Changing the country puts Region back on "Choose a region". Once both are chosen, show "Shipping to Ontario, Canada" (with the chosen region and country).
Your code must pass
- Region is disabled until a country is chosen
- Region lists the chosen country's regions
- Choosing both shows where it ships
- Changing the country resets the region