I don't know why either, but when I did switch to class names the
result was a big speed increase.  I guess attribute selecting is a lot
trickier to do than class matching.

On May 23, 6:39 am, Klaus Hartl <[EMAIL PROTECTED]> wrote:
> Daemach wrote:
> > You should definitely consider using a classname to select items like
> > this.  $('input.quantity') would be significantly faster.
>
> I don't know why using a class name would be significantly faster. Since
> there is no doucment.getElementsByClassName (yet), it doesn't make much
> difference to check for the class *attribute* or any other *attribute* -
> both are attributes. Maybe checking for a class is a bit more optimized
> because it is used more often. Have I overlooked something?
>
> What makes it faster is using a type selector and context.
>
> -- Klaus

Reply via email to