Sunday, October 2, 2011

unbind()

unbind(String type, Function fn) returns jQuery
The opposite of bind, removes a bound event from each of the matched elements. Without any arguments, all bound events are removed. If the type is provided, all bound events of that type are removed. If the function that was passed to bind is provided as the second argument, only that specific event handler is removed.

Example:

$("p").unbind()

HTML:
<p onclick="alert('Hello');">Hello</p>

Result:
[ <p>Hello</p> ]

No comments:

Post a Comment