Hi, I added the click event to a few <a> and they work perfectly fine, but when I try to do it with a FOR loop, it doesn't work anymore, does anyone has any idea about it?
Thank you.
/* works well */
$("a#1-a").click(function(){toggleTab(0);});
$("a#2-a").click(function(){toggleTab(1);});
$("a#3-a").click(function(){toggleTab(2);});
/* doesn't work */
var k=0;
for (k=0;k<totalNumberTabs;k++)
{
$("a#" + (k+1) + "-a").click(function(){
toggleTab(k);
});
}

