Here's a helpful clue for you to follow
- Start by creating an array
- Proceed to loop through the array and output an unordered list, or any other desired content.
Take a look at this example array provided:
itemList=["Canada", "US", "Mexico", "Belize", "Guatemala", "Honduras", "El Salvador", "Nicaragua", "Costa Rica", "Panama"];
Let's iterate through the list with the following code snippet:
for(var i=0; i<itemList.length; i++){
document.getElementById("myList").innerHTML+=
'<li>' +
itemList[i] +
'</ li>'
}
Note that the above loop is contained within a div element identified as "myList"
Consider organizing the loop into a function and then invoking it with the array data.
Name the function as follows: writeItems
ex: function writeItems()
Invoke the function while passing in the array like so: writeItems(itemList);
This will set you on the right path. Best of luck!