Event handling is very simple in this toolkit. There are two routines that accomplish this:
First argument specifies an element which should detect the event. Second is the event (without the 'on' prefix). Last argument is a valid function reference, i.e., the name of an existing function or Anonymous function.
var div = OAT.Dom.create("div"); OAT.Event.attach(div, "mouseover", function() { alert('Hi!'); });
or
OAT.Event.attach("some_id", "click", genericFunctionReference);
Use the same syntax as inOAT.Event.attach().: ThefunctionReferenceargument must exist in the current scope, so it is not possible to remove aneventhandled by anonymous function.
OAT.Event.detach(element, "click", functionReference);