Geoff
If they are unique and speed is important then id is the only way to go.
Classes are for when there are several instances of the same *type* of
thing.
rob
On 4/2/07, Geoffrey Knutzen [EMAIL PROTECTED] wrote:
I have the option of naming a few containers using either classes or ids.
It
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 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:
3 matches
Mail list logo