Why not use a selector in the first place?

$('div[id*=forum-list-]').hide();

Note that I added the type selector to make things faster. You may
have to adjust this.


--Klaus


On 13 Jun., 02:57, "Karl Rudd" <[EMAIL PROTECTED]> wrote:
> Remember the selector is just a string so you can built it up just
> like a normal string:
>
> for (var i=0; i<myCookies.length; i++)
> {
>        $('#forum-list-' + i).hide();
>
> }
>
> Karl Rudd
>
> On Fri, Jun 13, 2008 at 10:26 AM, yo2lux <[EMAIL PROTECTED]> wrote:
>
> > Is possible to use a for loop variable ( i ) in jquery $, something
> > like:
>
> > for (var i=0; i<myCookies.length; i++)
> > {
> >        $('#forum-list-[i']).hide();
> > }
>
> > I need the "i" value in $. But my code not work. Any idea ? Thanks!

Reply via email to