removes an event handler from an HTML element

void eventRemove(HTMLElement|string node,string event,function handler, [boolean|object options] );
nodeHTMLElement|stringthe HTML node or its id
eventstringthe name of an HTML event (without the 'on' prefix)
handlerfunctionthe event handler
optionsboolean|objectoptional, the value of either the useCapture or options parameter. Read details


const handler = function(event){
var element = document.querySelector(".my-element");
gantt.event(element, "click", handler);
gantt.eventRemove(element, "click", handler);


All event listeners attached using event will be detached automatically when the destructor is called.

See also
Change log

added in version 4.0

Back to top