Also not a direct answer to your question, but maybe an answer to why
you are asking it...

My initial guess would be that because you are just using a class as
your selector it is having to search through every single element on
the page (apparently over 20,000 of them) to find the elements that
have that class.  That takes a little while.

Your form.select selector looks for form elements of which I am sure
there are just a few, and then a select element inside of that...
again just a few.  In other words, the less work your selector has to
do, the faster it runs.  You could speed this up even more if you gave
the element an ID as that is even less parsing that it needs to do as
there should only ever be one of a given ID.

Hope that helps!

Aaron

On Feb 20, 9:13 am, Adam Schaible <[EMAIL PROTECTED]> wrote:
> Hello everyone,
>
>      On my page, I have a select element that may contain 20,000+
> options.  When I ask jQuery for the select element, it loads the set
> of options with it.  For 20,000 it takes about 1 - 1.25 seconds for
> jQuery to return from $('.boxClass)[0];.  When I use standard
> form.select it takes roughly 300 milliseconds.
>
> Is there a way to lazy load the options of a select?

Reply via email to