Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3) Using Javascript and the following array variable var countries = [ { code: AR, name: Argentina, capital: Buenos Aires }, { code: AT, name:

3) Using Javascript and the following array variable var

countries = [ { code: "AR", name: "Argentina", capital: "Buenos Aires" },

{ code: "AT", name: "Austria", capital: "Vienna" },

{ code: "BE", name: "Belgium", capital: "Brussels" },

{ code: "CA", name: "Canada", capital: "Ottawa" } ];

write an HTML page containing only JavaScript (no jQuery) that would use a loop to generate a drop-down list that would display the country names. The value attribute for each item in the list should be the country code. Add an event handler for the drop-down lists change event. This handler should display the capital city of the currently selected country within the

element that is after the