The closest equivalent to jQuery has .bind() , for example:
$("#element").bind('eventName', function(e) {
And .unbind() remove the handler, for example:
$("#element").unbind('eventName');
There are also shortcuts for .bind() , so, for example, click can be done in two ways:
$("#element").bind('click', function() { alert('clicked!'); });
There is also .live() ( .die() to untie) and .delegate() ( .undelegate() to untie) for bubbling-based event handlers rather than direct attachments, like dynamically generated elements.
The examples above were anonymous functions, but you can provide the function directly, like dojo (or any javascript), for example:
$("#element").click(myNamedFunction);
source share