Listens to an event on document
or a given element.
The event handler is called with the event target as a
jQuery collection.
If you're not using jQuery, use up.on()
instead, which calls
event handlers with a native element.
up.$on('click', 'a', function(event, $link) {
console.log("Click on a link with destination %s", $element.attr('href'))
})
The element on which to register the event listener.
If no element is given, the listener is registered on the document
.
A space-separated list of event names to bind to.
The selector of an element on which the event must be triggered. Omit the selector to listen to all events with that name, regardless of the event target.
The listener function that should be called.
The function takes the affected element as the first argument).
If the element has an up-data
attribute, its value is parsed as JSON
and passed as a second argument.
A function that unbinds the event listeners when called.