Menu
Hi, I have this piece of code:
[code]
for (var i=0; i < 6; i++)
{
$(‘a#chan’+i).click(function(){
for (var j=0; j<6; j++)
{
$(‘a#chan’+j).removeClass(“chSel”);
}
$(this).addClass (“chSel”);
channel = i;
});
}
I know I use jQuery. The variable channel is declared this first thing in the Javascript using
[code]var channel = 0;
. I’m trying to put the current value of i in the variable channel but, everytime it loops, it stores 6. I tried using break; and still no luck; it goes to 6 anyways. I need help on this.
Thanks.