hang on to the jquery reference instead of repeating the lookup in the loop. Also, update the textContent property instead of using .html()