attachEvent
adds any user-defined handler to available events
number attachEvent(string name,function handler);
| name | string | name of the event | 
| handler | function | user-defined event handler | 
| number | internal event id, you can use it for detachEvent(id) | 
Example
// attach event
var evId = myComponent.attachEvent("eventName", function(){
    // your code here
});
 
// detach event
myComponent.detachEvent(evId);
Details
- several handlers can be attached to one and the same event, and all of them will be executed
- event names are case-insensitive
Back to top