Aaron Heimlich schrieb:
> On 12/12/06, *David Duymelinck* <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
>     I thought div#myid was less generic than #myid so that the performance
>     would improve using something like that. #myid could match a form, a div
>     or some other tag you apply the id to.
> 
> 
> This might be true in CSS, but when jQuery sees something like "#myid", 
> it turns that into document.getElementById("myid") which is very fast.
> 
> I can't say for sure, but I think that if jQuery saw something like 
> "div#myid", it would do document.getElementsByTagName("div") and then 
> document.getElementById("myid")


I think it's even worse. It has to go through all the divs and check the 
id...
document.getElementById cannot be used for such a list returned by 
document.getElementsByTagName("div").


-- Klaus


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to