attaches an event handler to an HTML element
node | HTMLElement|string | the HTML node or its id |
event | string | the name of an HTML event (without the 'on' prefix) |
handler | function | the event handler |
master | object | an object that the this keyword refers to |
string | the event handler id (can be used by the eventRemove() method) |
// adds a handler for the 'onclick' event
scheduler.event("divId", "click", function(e){
//e - a native event object
do_something();
});
All event listeners attached using event will be detached automatically when the destructor is called.
added in version 4.4
Back to top