Listen for events from the children of an element.
can.delegate.call(element, selector, eventName, handler)
The HTML element to bind to.
A selector for delegating downward.
The name of the event to listen for.
The function to execute when the event occurs.
can.delegate(selector, eventName, handler)binds a delegate handler on an object for a given event. It works on:
The idea is that delegate can be used on anything that produces delegate events and it will figure out the appropriate way to bind to it. Typically,
can.delegateis only used internally to CanJS; however, if you are making libraries or extensions, use
can.delegateto listen to events independent of the underlying library.
Delegate binding to an HTMLElement