event

attaches an event handler to an HTML element

string event(HTMLElement|string node,string event,function handler, [object master] );

Parameters

nodeHTMLElement|stringthe HTML node or its id
eventstringthe name of an HTML event (without the 'on' prefix)
handlerfunctionthe event handler
masterobjectan object that the this keyword refers to

Returns

stringthe event handler id (can be used by the eventRemove() method)

Example

// adds a handler for the 'onclick' event
scheduler.event("divId", "click", function(e){
    //e - a native event object
    do_something();
});

See also
Change log

added in version 4.4

Back to top