Home >Web Front-end >JS Tutorial >Introduction to the difference between event.currentTarget and event.target_javascript skills
event.currentTarget identifies the current target for the event, as the event traverses the DOM. It always refers to the element the event handler has been attached to as opposed to event.target which identifies the element on which the event occurred.
That is, event.currentTarget points to the element to which the event is bound, while event.target always points to the element when the event occurs. The translation is unprofessional and hard to pronounce. Let’s go directly to the test code: