3 ms·
Some of the advice is just plain wrong depending on your target platform. For example, on my iPad, iPhone 3G (not 3GS), and Safari 5.0 (6533.16)/Mac, using cre
by mayoff 16y ago
Some of the advice is just plain wrong depending on your target platform. For example, on my iPad, iPhone 3G (not 3GS), and Safari 5.0 (6533.16)/Mac, using createElement/appendChild is consistently faster than using innerHTML. In Chrome 5.0.375.70/Mac, they are the same speed. In Firefox 3.6.3/Mac, naive createElement is slower, but using a DocumentFragment makes it as fast as innerHTML.
My test case: http://dqd.com/~mayoff/timeDom.html http://dqd.com/~mayoff/timeDom.html