event 事件对象 The event object
Last updated: 2026-09-09
event 事件对象 The event object
The event object contains all event info: target, type, coordinates.
| Category | DOM |
|---|---|
| ES version | DOM |
📝 Syntax
el.addEventListener('click', (e) => { e.target });
Returns:The event object (auto-passed to callback).
Mutates the original:No (returns a new value)
▶ Example
Edit the code, press Run, and see the result in the output panel:
Output:
click
[HTMLButtonElement]
0
💡 Tip preventDefault stops default behavior like form submission.
ℹ️ info target = actual element; currentTarget = element with the listener.
🌐 Browser support
| Browser | |||||
|---|---|---|---|---|---|
| event 事件对象 | ✓ v1 | ✓ v12 | ✓ v1 | ✓ v1 | ✓ v1 |
| Supported by all modern browsers | |||||
🏷️ Related Items
💡 Related Cases
More case studies coming soon — check back later.
📚 Related Tutorials
❓ FAQ
Qtarget vs currentTarget?
Atarget is the actual element clicked; currentTarget is where the listener is bound.
QpreventDefault vs stopPropagation?
ApreventDefault stops default behavior; stopPropagation stops bubbling.
QWhat is event bubbling?
AEvents propagate from child up to parent — all the way to document.