Back

.on( events, handler )

Bind some event handler to each element in the current set

Aliased as .bind() for compatibility

Params

events{String}A space-separated list of events to listen for
handler{Function}A function to execute when one of the events is triggered

Returns

DollarJS (chainable)

Examples

$('p').on('click', function(event){ console.log(this); })
$('p').on('custom', function(event){ console.log(event.detail); })