Which of the following would theoretically be better with performance and / or memory? In other words, does jQuery have to do work to select the same item multiple times or does it know what items it has selected in the past?
I've intentionally left animate with no arguments, this is a purely theoretical question.
$("#someelement").animate();
$("#someelement").animate();
$("#someelement").animate();
$("#someelement").animate();
$("#someelement").animate();
$("#someelement").animate();
$("#someelement").animate();
$("#someelement").animate();
$("#someelement").animate();
$("#someelement").animate();
or
var element = $("#someelement");
element.animate();
element.animate();
element.animate();
element.animate();
element.animate();
element.animate();
element.animate();
element.animate();
element.animate();
element.animate();