Append the HTML after the loop, to touch the DOM only once.