[Javascript] Efficiency of innerHTML over DOM tree manipulation

Matt Barton javascript at mattbarton.org
Wed Jun 28 06:15:32 CDT 2006


Hi,

I've hit a problem with my companies web application in that I need to 
dynamically create a (potentially very large) number of html select 
controls in a page, in javascript.

We have been, up to now, using the innerHTML property of a parent div to 
plant the select control code in the correct place in the page.

However, of late, we have seen our pages which do involve a large number 
of these dynamically created select controls running much slower than we 
would ideally like.

My question to the group is, would there be any intrinsic efficiency 
benefit in our switching to use the DOM tree manipulation method that 
some ajax programmers use to insert html snippets into web pages?

Is either method more efficient than the other?

Thanks in advance

Matt



More information about the Javascript mailing list