Tom,

You could do it one of two ways:

1) When you generate your random divs, just assign them all a
classname <div class="random" id="divname1234">content</div>

Then use $('div.random').doStuff();

2) You could get all divs in the dom and check whether their id
attribute matches div[0-9]+, something like:

$('div').each(function()
{
   var id = $(this).attr('id');
   if (id == SomeRegex())
      //valid.
}
);

On Apr 15, 3:07 pm, "Glen Lipka" <[EMAIL PROTECTED]> wrote:
> On 4/14/07, Tom Shafer <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hi, i need to be able to find all elements with a div id of something
> > like divname plus some randmom number, each div id will be like this,
> > so something like divname324 or divname453
>
> > so how can I select all divs with a name divname plus some random
> > numbers
>
> > $("#divname + random number").ajaxForm({
> >        target: '#commentFormOutput',
> >        success:   processcommentForm
> > });
>
> > Thanks
>
> > -TJ
>
> You can concatenate..like this:
>
> var randomnumber=Math.floor(Math.random()*11);
> $("divname" + randomnumber).dostuff();
>
> Is that what you were looking for?
>
> Glen

Reply via email to