Based on this I am trying to add the click event handler to an array of objects by writing this:
function addEventHandler(array, type, func) {
var len = array.length;
for (var i = 0; i < len; i++) {
array[i].bind(type, func);
}
}
sections = $('#sponsorship > div .section')
addEventHandler(sections, 'click', function() {
console.log(this);
});
However, I am getting the error message:
array[i].bind is not a function
Can I only use actual selectors on a bind method? Any suggestions?