Whats better?
1. Copy all of the innerHTML to a variable and change an attribute for each element in the variable, then replace the original innerHTML with the changed variable
2. Iterate through each element inside changing the attribute, but accessing the DOM lots and lots of times?