If the selector doesn't return any elements, the .each() won't happen, so it won't loop. I'm not positive that your way isn't slightly more efficient, but it's not necessary.
I generally do a variable assignment like you are doing if I'm going to use the collection more than once. Otherwise, I just use the selector directly.
M.
I generally do a variable assignment like you are doing if I'm going to use the collection more than once. Otherwise, I just use the selector directly.
M.