Fork me on GitHub

gator.js

simple event delegation in javascript

introduction

download

Gator is a small (~0.8 kb minified + gzipped), simple, standalone, event delegation library.
If you are familiar with jQuery then it may look familiar to you.

Gator(document).on('click', '.expand', function(e) {
    e.preventDefault();
    _doSomething(this);
});

browser support

Out of the box gator works in Chrome, Safari 5+, Firefox 3.6+, and Internet Explorer 9+. The legacy.js plugin adds support for Safari < 5, and Firefox < 3.6 and Internet Explorer 6, 7, and 8.