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


Reply via email to