The children of the container are the elements that decisions are
going to be made on based on the values of form fields inside them, so
doing the each on the fields directly isn't an option.  I'm going to
use the classes idea, which seems more practical for what I want.
Thanks.

On May 22, 4:29 pm, Gordon <[EMAIL PROTECTED]> wrote:
> I am writing a script that scans a list of items that each contain
> form fields and doing something based on the value of the field in
> each item.  I came up with the following code, which does seem to work
> as intended, but execution can take upwards of 500ms, which I feel is
> rather slow.
>
> var container = '#myElem';
>
> $(container.children ()).each (function ()
> {
>         thisVal = parseInt ($('[EMAIL PROTECTED]"quantity"]', this).attr 
> ('value'),
> 10);
>         // Do stuff
>
> });
>
> Obviously the fields can't have the same ID as that would break the
> validity of the HTML.  Field names do not have to be unique so it
> seemed logical to use them as the basis of selecting the collection of
> elements to work with.

Reply via email to