enode.off()
enode.off() is used to remove an event listener from the associated HTML element of the current enode.
Since this method is built on top of EventTarget.removeEventListener() in Web APIs, their usage is basically the same.
Syntax
JavaScript
enode.on(eventType: String, eventCallback: Function, options: Object)
Parameters
eventType
- A case-sensitive string which specifies the type of event.
eventCallback
- The event handler function to remove from the event target.
options (optional)
- An object that specifies characteristics about the event listener. For available options, read here.
Return value
The current enode, ready for the chaining method calls.
Examples
JavaScript
var button = new Binh.ElementNode(document.createElement('button'));
function eventOnClick(event) {
// hanle event
alert('clicked');
}
button.on('click', eventOnClick);
button.off('click', eventOnClick);