[jQuery] Howto assign $(this) to variable
Hi,
I'm pretty new to jQuery, and I have stumbled across a weird problem.
It may just be me fooling around, anyway here goes...
var foo = false;
$('div span').each(function() {
foo = $(this);
// debugging in firebug
console.log($(this), foo);
console.log($(this) == foo);
});
You should, at least I am, think it's the same element, although it
returns false! I cannot figure out why.