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 need pass the index (i)
Edit: Illustration: http://jsfiddle.net/mUjAj/