Thursday, April 19, 2012

Javascript getElementById lookups - hash map or recursive tree traversal?


Does the DOM have a hash-table of elements whose keys are the elements' ids?





I want to know if document.getElementById looks up a hash table or traverses the entire tree.

Is this behavior different across browsers?


Source: Tips4all

No comments:

Post a Comment