I have a lab about addEventListener
, where in a click of a button shows your for loop with office locations.
const grupList = document.querySelector("ul");
console.log(grupList);
const listItems = document.querySelector("li");
console.log(listItems);`
const offices = document.getElementById("ofLocations");
let officeLocations = ["New York", "London", "Paris", "Tokyo", "Sydney"];
```function getOfficeLocations (arr){
``` for (let i = 0; i < arr.length; i++) {
`console.log(arr[i]);
```offices.addEventListener("click", getOfficeLocation {
})
}
}
`getOfficeLocation(officeLocations);`
This is what I have done so far.