Erik I was under the impression that the exact opposite was true for
searches by class: that including the tag slows it down.
I may be mistaken, you'd have to check the list archives or perhaps check
the script, I may do the same tomorrow.

rob

On 4/2/07, Erik Beeson <[EMAIL PROTECTED]> wrote:


ID is found by using document.getElementById(), which is probably
about as fast a DOM operation as can be had. Use ID for sure.

Also, if I'm not mistaken, it helps class searches a lot if you also
include the tag that you're looking for: $('div.someClass') instead of
just $('.someClass').

--Erik


On 4/2/07, Geoffrey Knutzen <[EMAIL PROTECTED]> wrote:
>
>
>
>
> I have the option of naming a few containers using either classes or
ids. It
> is assured that there will only be 1 instance of one of these containers
on
> any page.
>
> Is it better to name them with a class or an id?
>
> Is there any speed benefit from using an id?
>
>
>
> These containers will be accessed rather frequently, so speed would make
a
> difference
>
>
>
> Any thoughts?
>
>
>
> Thanks
>
> -Geoff
>
>




--
Rob Desbois
Eml: [EMAIL PROTECTED]
Tel: 01452 760631
Mob: 07946 705987
"There's a whale there's a whale there's a whale fish" he cried, and the
whale was in full view.
...Then ooh welcome. Ahhh. Ooh mug welcome.

Reply via email to