count=1;
for(var i=0;i<5;i++){
count++;
$("#ImageProductLeft"+count.toString()).bind('click', function(){
alert(i);
});
}
I want that when click on ImageProductLeft1 show alert(1) and click on ImageProductLeft2 show alert(2) and …
But onclick on all ImageProductLeft1 show alert(5).
1 Answer