JavaScript · Junior · Question 71 of 75
In a click handler attached to <ul>, how do event.target and event.currentTarget differ?
- ✓Correct answer:
targetis the element actually clicked (e.g. an<li>);currentTargetis the<ul>the handler is attached to - 2They are always the same
- 3
currentTargetis the previously clicked element
Explanation
This difference is the basis of event delegation: one handler on the parent inspects event.target (often with closest()).