delegated
A tiny little cross-browser event delegation library. Uses Element.matches for CSS selector-based filtering.
Example
var parent = document; parent; parent;
Example using Mithril
; ;
API
All calls to delegated(...)
return an event handling function that will check nodes up to the parent to see if they match specified filter(s).
delegated(<string>, <function>)
- Single string filter & callback function.
delegated(<object>)
- Each property of the object is used as the filter, and the value of the property should be the callback function.