please help...how to create a link to "this" in anoymous function?
HTML Code:
(function() {
    
    function OnClick()
    {
        console.log(that.id);
    }
    ClassA = function(id)
    {
         this.id = id;
         this.element = document.getElementById(id);
         this.element.onclick = OnClick;
         // secret link
         that = this;
    }
})();

for(var i...)
{
      var x = new ClassA("element_" + id);
}
if i do so..."that" in each instance of ClassA is always the last instance. I understand why it doesn't work...but it just interesting..is it possible to create somehow this secret link or not?
I have tryed so:

HTML Code:
that = function (t) {
        return t;
}(this);
and so...
HTML Code:
GetThis = function (t) {
     return function () { return t };
}(this);
nothing works...is it possible?