Event delegation (fork of jonathanong/delegate)