Do you have a sample page where this problem shows up? It would make
debugging a lot easier. There must be some other problem at work here.
Using a variable as the parameter should not matter, jQuery doesn't
even know where the value comes from (from a var or hardcoded).

--
Suni

On 22 marras, 03:19, pcadi <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have the weirdest of bug. If I do:
>
> var item1 = 3;
>
> $("#"+menu+" .itemMenu li").eq(item1).addClass("highlight");
>
> Then all the li elements get highlighted.
>
> If I do:
>
> $("#"+menu+" .itemMenu li").eq(3).addClass("highlight");
>
> it works fine.
>
> How do I use a variable in a jquery query?
>
> Thanks in advance,
>
> P.

Reply via email to