W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2006

Re: DOM FAQ

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 29 Mar 2006 12:50:39 -0600
Message-ID: <442AD6FF.1090702@mit.edu>
To: Garrett Smith <dhtmlkitchen@gmail.com>
CC: DOM mailing list <www-dom@w3.org>

Garrett Smith wrote:
> getElementsByTagName('body').item(0);
> 
> (or for better performance)
> 
> getElementsByTagName('body')[0];

For what it's worth, I believe the former is a tiny little bit faster 
than the latter in Gecko, though the difference is pretty minuscule.

-Boris
Received on Wednesday, 29 March 2006 18:50:24 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:58 GMT