JavaScript JavaScript and the DOM Responding to User Interaction Listening for Events with addEventListener()

Why not use <ul> as a list?

Guil said that we want to get as close as possible to our target elements. So why have we not used the <ul> parent element as opposed to the <div> element we used? Just curious

1 Answer

Steven Parker
Steven Parker
186,662 Points

Which code are you referring to? The listeners added in the video in the "Watch Video" link are all attached directly to the list items ("li").