The second example does not work, because every time you use a function $(this), it returns a unique jQuery object :
var a = document.createElement('a');
var b = $(a);
var c = $(a);
Now b and c are unique instances of jQuery.
console.log(c == b) // prints false
When using jQuery click events, thisthis is event.currentTarget in the callback, which is the HTML element that binds the click:
button.click(function(e) {
console.log (e.currentTarget == this)
})
$(this) jQuery(this) - , HTML, jQuery, jQuery.