The slow method invokes the HTML parser each time the innerHTML property is set. To improve performance, a string can be built which is then assigned to the innerHTML property.
Click the buttons to see the difference in performance.