Could someone please explain a bit, what difference between them?
For example I could do that with "that":
var bar;
button.click(function () {
if (bar == this) {
alert('same');
}
bar = this;
});
and couldn't with $(that):
var bar;
button.click(function(){
if(bar == $(this)) {alert('same');}
bar = $(this);
});