onchange event handler exercise unclear : Im doing an exercise that is getting me used to onchange event handlers and arrays. I am having great trouble with what its asking me to do. Any help would greatly appreciated. Here is my code:

document.getElementById('productID').onchange = function () {

    productID = this.value;

    iName = imageName[productID];

    url = urlBase + iName;

    iPrice = imageName[productID];

    document.getElementById('...').innerHTML = iPrice;

};




Here are the instructions.





1. Handle the onchange event for the select list; id 'productID'

 

2. Get the productID of the selected fruit this way:

productID = this.value;

 

3. Use parseInt() to ensure the productID value is a number.

 

4. Get the image name for the selected product by using productID to reference the array imageName this way:

     iName = imageName[productID];

 

5. Combine urlBase + image's name to get the full url to the image. Do it this way:

     url = urlBase + iName;

 

6. Load url as the src for the <img> with id 'product image'.

 

7. Get the price of the product by using productID and the price array. Put the price of the product in the variable iPrice.

    Refer to #4 about how to do this.

 

8. Set the innerHTML of the span 'price display' to the price. Do it this way:

document.getElementById('...').innerHTML = iPrice;




Any help would be greatly appreciated. I am slowly learning more and more and I enjoy html a lot so far.