Started

Selectors

Utilities

Animation

AJAX

CSS

Event

Manipulation

Cookie

String

Attributes

Data

Storage

Miscellaneous

$event.off

Detach event handler from element.
$event.off( element, type, handler )
  1. element [object]
    The target element.
  2. type [string]
    DOM event type
  3. selector (optional) [string]
    simple DOM selector, supported "#", "." and "tag" syntax.
  4. handler [function]
    The function that will be executed when the event is triggered.

Notes

Detach event handler which attached by $event.on.

Example

HTML code
<div id="box">This is a box</div>
<button onclick="start_attach_event()">Attach onclick event for box</button>
<button onclick="start_detach_event()">Detach onclick event for box</button>
CSS code
#box {
	width: 200px;
	height: 60px;
	font-size: 12px;
	background: #5599bb;
	padding: 10px;
}
JavaScript code
var box_event_handler = function ()
{
	alert("You clicked the box");
};
function start_attach_event()
{
	$event.off($("box"), "click", box_event_handler);

	alert("Onclick event attached. Try to click the box.");
}
function start_detach_event()
{
	$event.off($("box"), "click", box_event_handler);

	alert("Onclick event detached. Try to click the box.");
}
Demonstration
This is a box