jQuery: Differences between $(this) and this
<p>I'm trying to understand what differences are between <code>$(this)</code> and <code>this</code> in <code>jQuery</code>, and eventually find a way to get <code>$(this)</code> object from <code>this</code> (<code>this</code> what??):</p>

<pre><code>var last_btn;
$("#element").click (function () {
    if (last_btn != null &amp;&amp; last_btn == this) {
        // to unselect the current button
        last_btn.removeClass ("selected"); // doesn't work because this is not $(this)
    } else {
        if (last_btn != null) last_btn.removeClass ("selected"); // to unselect another old button
        last_btn = this;
        $(this).addClass ("selected");
    }
});
</code></pre>

<p>As written in <a href="http://stackoverflow.com/questions/4058783/jquery-check-if-an-element-is-assigned-to-a-var">this post</a>, I need to use <code>this</code> instead of <code>$(this)</code> object because it's the only way to assign a <code>jQuery</code> object to a var without loose his instance.</p>

<p>How can I do that?</p>
