Re:JQuery implicit loops
by sim0n on Friday February 01, 2013 @01:54PM
(#5152580)
There must obviously be two loops, jQuery can't perform magic. The first .css() call will iterate over the cached array of elements, apply the color attributes and then return a reference to the jQuery instance. The second call will loop once again and this time apply the font-size attribute.
There is no extra DOM lookups, but there will certainly be two loops.
There is no extra DOM lookups, but there will certainly be two loops.