Hi,

> although i couldn't see one or the other or even the other being much
> faster considering that the selector would have to go through all the
> elements to see if *any* element on the page either (1) has the
> specified class or (2) has the specified id

There is document.getElementById() which usually is really fast. If you use 
$('#toto1') uses that. That is why I am not really shure. If you use 50 or 
more times $('#toto'+n).hide() I'd expect the parser and the many function 
calls to take up quite some time, so that the whole construct should not be 
faster than using the class $('.toto').hide().

If all relevant Elements are in the same container, then I'd expect 
$('#container > .toto').hide() to be a good solution. If all the relevant 
Elements are divs and there are more elements in the container, then 
$('#container > div.toto').hide() might give you a bit more speed.

Christof


Reply via email to