this != $(this)
In your first case tst
is a reference to the jQuery object, but in the second this
is simply the corresponding DOM element.
Within an .each()
loop the .selector property is not available, however. To access '.tst' you can do $(this).attr("class")
(when you use a class selector) -- though if you already use it in the each you can just cache it in a variable before hand.
Note that this will return all of the classes for that elements, so you can parse it later if it has more than one.
The best workaround based on your exact description is this:
var $tst = $(".tst");
$tst.each(function() {
console.log($tst.selector); //prints .tst
});
However I can't see any reason why you really need to do this.