Select multiple HTML elements

In this scenario, we are looking for a list of elements gathered in one variable - rather than only one element.
Assign the list items in the view to the variable 'listItems' by using an appropriate selector method.
Once you have completed the code below, verify it by hovering over the list items until all items have the value 'ON'
  • OFF
  • OFF
  • OFF
  • OFF
  • OFF
  • OFF
View
<ul id="list">
<li>OFF</li>
<li>OFF</li>
<li>OFF</li>
<li>OFF</li>
<li>OFF</li>
<li>OFF</li>
</ul>
HTML
// assign the correct elements to the variable
const listItems =
const handleHover = (event) => { return event.target.innerText = 'ON'; }; if(listItems.length > 1) { listItems.forEach(item => item.addEventListener('mouseover', handleHover)); }
Javascript