Reduce DOM accesses through caching the results of DOM queries in variables and by performing batch updates as much as possible to minimize the number of reflows and repaints.