[jquery] How to pass arguments to an event handler?
var MyObject = { init: function () { this.items = $('#menu a'); for (var i = 0; i < this.items.length; i++) { $(this.items[i]).bind('click', this.doSomething); } }, doSomething: function (index) { alert(this.items[index].innerHTML); // alerts: One, Two, Three } }; I ...