event.type is a String that describes the nature of the event — "click", "keydown", or a custom name like "saveDraft". Since jQuery 1.0. It is the base name only (no namespace). Works with native events and .trigger().
Remember
event.type // "click", "keydown", "saveDraft", …
event.namespace // "myPlugin" for click.myPlugin (or "")
// Official pattern
$("a").on("click", function (event) {
alert(event.type); // "click"
});
Read it inside any handler to learn which event fired.
Bind with .on("click", fn) or multi: .on("click keydown", fn).
Inside the handler, read event.type.
Branch with if / switch when one function handles several events.
For customs, bind and .trigger("saveDraft") — type is "saveDraft".
Remember: namespaces do not appear in type.
Piece
Required?
Role
event argument
Yes
jQuery event object
event.type
Yes (to inspect)
Base event name string
Multi-event bind
Optional
One handler, branch on type
.trigger(name)
Optional
Custom types
Pseudocode
Pseudocode
element.on("click keydown saveDraft", handler)
when an event fires:
type = event.type // "click" | "keydown" | "saveDraft"
switch type:
case "click": handle click
case "keydown": handle key
case "saveDraft": handle custom
// click.myPlugin → type is still "click"
Reference
Cheat Sheet
Keep these facts handy while reading event names.
Topic
Detail
Type
Property → String
Since
jQuery 1.0
Meaning
Nature / base name of the event
Examples
click, keydown, saveDraft
Namespace
Not included — see event.namespace
Custom events
Same property via .trigger()
Try it
Live Preview
Click a link — the log shows event.type, like the official demo.
A → type: click, ns: pluginA
B → type: click, ns: pluginB
How It Works
Two binds.click.pluginA and click.pluginB.
Same type. Both report "click".
Different ns.event.namespace tells them apart.
Rule. Type = base; namespace = dotted suffix.
Edge Cases & Pitfalls
Watch for these when reading event names.
ns
No namespace in type
click.foo still has type === "click". Use event.namespace for foo.
case
Lowercase names
jQuery event names are lowercase ("click", not "Click"). Match that in switch/if.
orig
Prefer event.type
Synthetic triggers may lack originalEvent. Rely on event.type in jQuery handlers.
multi
Shared multi-handlers
Always branch on event.type — otherwise click and mouseenter share the wrong logic.
Compatibility
Browser Support
event.type is a standard DOM Event property. jQuery exposes it on the normalized event object since 1.0. Works wherever your loaded jQuery version runs.
✓ Stable · Event property
event.type
Supported in all modern browsers via the DOM Event API. Prefer jQuery 3.x for a consistent event object across native and custom events.
100%Property support
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
typeUniversal
Bottom line: Safe for production. Use type for the base name; use namespace for the dotted suffix; use .trigger() for custom names.
Analysis
Performance Notes
Approach
Cost
Best for
Read event.type
Free
Identifying the event
Multi-event one handler
Cheap
Shared UI feedback
Separate binds per type
Fine
Very different logic per event
Custom .trigger()
Tiny
App-level messaging
Reading type has no meaningful cost. Prefer one multi-event handler when the logic is similar; split binds when branches grow large.
Remember
Key Takeaways
Role: String describing the nature of the event.
Base only: no namespace in type.
Multi / custom: branch on type; customs work too.
Prefer:event.type over originalEvent.type.
One line:event.type answers “what kind of event is this?”
Frequently Asked Questions
event.type is a String on the jQuery event object. It describes the nature of the event — for example "click", "keydown", or a custom name like "saveDraft". Available since jQuery 1.0. It holds the base event name without any namespace suffix.
Bind click on anchors: $("a").on("click", function(event) { alert(event.type); }); // "click". The alert shows the base type string for every anchor click.
For a bind like click.myPlugin, event.type is "click" (the base name) and event.namespace is "myPlugin" (the dotted suffix). event.type never includes the namespace.
Yes. Bind .on("click mouseenter mouseleave", fn) and branch with event.type — each dispatch sets type to whichever event fired.
Yes. When you .trigger("saveDraft") or bind .on("saveDraft", fn), event.type is "saveDraft". jQuery sets type for native DOM events and custom triggers alike.
Usually yes for native DOM events. For synthetic jQuery triggers with no underlying DOM event, originalEvent may be undefined while event.type still holds the triggered name. Prefer event.type in jQuery handlers.