click is sent when the mouse button is pressed and released while the pointer stays inside an element. Bind it with .on("click", handler) (jQuery 1.7+).
Remember
$("#target").on("click", function () { ... })
$("#target").trigger("click")
// Needs: mousedown + mouseup inside the element
// Prefer on/trigger — not the deprecated .click()
Select an element, bind with .on, optionally trigger from code.
Select the element(s): $("#btn"), $("p"), etc.
Bind: .on("click", function (event) { ... }).
Use $(this) for the bound element; read event for details.
To fire in code: .trigger("click"). Unbind with .off("click").
Piece
Required?
Role
"click"
Yes
Event type string for .on / .trigger
handler
Yes (bind)
Runs on each click
eventData
Optional
Extra data passed into the handler
Return value
—
jQuery set (chainable)
Pseudocode
Pseudocode
function onClick(element, handler):
when mouse down inside element
and mouse up inside element:
handler(event)
trigger(element, "click"):
run all click handlers on element
(may also run default browser action)
Reference
Cheat Sheet
Keep these facts handy while wiring click handlers.
Topic
Detail
Bind
.on("click", handler) (1.7+)
Trigger
.trigger("click") (1.0+)
Sequence
Press + release inside the element
Delegation
.on("click", childSelector, fn)
Unbind
.off("click")
Deprecated
.click() shorthand (3.3+)
Try it
Live Preview
Click the demo control (or use presets) to see on("click") in action.
Uses .on("click") and .trigger("click") — same ideas as the examples below.
Result
Handler for click called.
Code
jQuery Examples
Short, copy-ready snippets. Open DevTools Console, or use Try It Yourself for a live editor.
Example 1 — Bind a Click Handler
Official style: .on("click", …) on a target element.
jQuery
$("#target").on("click", function () {
console.log("Handler for click called.");
});
User clicks — press and release inside the element.
Handler runs once per completed click.
Example 2 — Trigger a Click from Code
Fire the same handlers without a real mouse click.
jQuery
$("#target").on("click", function () {
console.log("Handler for click called.");
});
$("#other").on("click", function () {
$("#target").trigger("click");
});
One parent handler covers current and future children.
jQuery
$("#list").on("click", "li", function () {
console.log("Clicked: " + $(this).text());
});
// Later…
$("#list").append("<li>New item</li>");
// New item is clickable too — no extra bind
Deprecated in 3.3. Use .on("click") / .trigger("click") / .off("click").
sequence
Incomplete press/release skips click
If the pointer leaves before release, you may get mousedown/mouseup without click. Use those events when that matters.
dynamic
New DOM nodes need delegation
Binding only existing elements misses later inserts. Prefer .on("click", "child", fn) on a stable parent.
target
this ≠ always event.target
Clicks on nested spans/icons set event.target to the child. Use this (or event.currentTarget) for the bound element.
Compatibility
Browser Support
The native click event works in all browsers. Bind with .on("click") since jQuery 1.7; .trigger("click") since 1.0. Prefer these over the deprecated .click() shorthand (3.3+).
✓ jQuery 1.7+ (.on)
click event
Supported everywhere jQuery event APIs run in the browser. Use on/trigger for modern code.
100%Browser 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
on("click")Excellent
Bottom line: Bind with .on("click", fn). Trigger with .trigger("click"). Use delegation for dynamic lists.
Analysis
Performance Notes
Approach
Cost
Best for
Direct .on("click")
1 handler / element
Few static controls
Delegated .on
1 handler / parent
Lists / tables / dynamic UI
Many direct binds
Higher memory
Avoid on large collections
Delegation scales better than binding hundreds of individual click handlers. Always .off when removing long-lived widgets to avoid leaks.
Remember
Key Takeaways
Bind:.on("click", handler) — not deprecated .click().
Fire:.trigger("click") for programmatic clicks.
Delegate: one parent handler for dynamic children.
Sequence: needs press + release inside the element.
One line: use .on("click", fn) to listen and .trigger("click") to fire — prefer that over the deprecated .click() shorthand.
Frequently Asked Questions
click fires when the mouse button is pressed and released while the pointer stays inside the element. Bind with .on("click", handler) (jQuery 1.7+). Any HTML element can receive it.
Prefer .on("click", handler). The .click(handler) shorthand is deprecated since jQuery 3.3. To fire the event, use .trigger("click") instead of .click().
click needs both press and release inside the same element. mousedown fires on press; mouseup on release. Use mousedown/mouseup when you do not need the full click sequence.
Call $(selector).trigger("click"). That runs bound handlers (and default actions). Use .triggerHandler("click") to run handlers without default browser behavior.
Bind once on a parent: $("#list").on("click", "li", fn). Clicks on matching children (including ones added later) bubble to the parent and run the handler.
this is the element the handler is bound to (or the matched child with delegation). event.target is the deepest node actually clicked — often a child inside this.