jQuery off() Method
jQuery off() Method
The off() method is used to remove event handlers attached with the on() method. It is relatively new compared to previous similar functions like unbind(), die(), etc.
Syntax:-
Its syntax is:- $(selector).off(event,selector,function(eventObj),map)
Further Explanation:-
Parameter | Description |
---|---|
event | Required. Specifies one or more events or namespaces to remove from the selected element. |
selector | Optional. A selector which should match the one originally passed to the on() method when attaching event handlers |
function(eventObject) | Optional. Specifies the function to run when the event occurs |
map | Specifies an event map i.e, containing one or more event to attach to the elements. |