When we want to add event listeners
to items in a list, we need to select
list items and add event listener on
each item one by one.
Let us have a look at another example:
In the code above, we select
all the list items with the
class list-item.
After this step, we iterate
through each individual list item,
and add a click
event listener.
When the list item is clicked,
we change the background to
blue
and font color to white
.