Does caching jquery selectors keep a dynamic copy of that selector or just that selector at the time of assignment? What I mean is that I cache the variable at the top of my document and later try to use it and it just won't work.
var $cell = $('#grid .cell');
// much later in code
$cell.each(function (index) {
// random code
});
if I change out the variable for the jquery selector $('#grid .cell').each()..
it works. The only reason I can come up with is that the selectors contents have changed since I assigned the variable