Question: I am using Simple JavaScript Inheritance by John Resig.
I know that I can use `this` variable to share values between methods:

```
var Person = Class.extend({
  init: function(isDancing){
    this.dancing = isDancing;
  }
});

```

I would like to create a pointer to `this` so that it would not be overwriten later like:

```
$('#id').click(function() {
  // this now points to selector
});

```

How can I create let's say `that = this` pointer which would be accessible classwide?

Answer: 
You can use '.apply()'

```
var Person = Class.extend({
  init: function(isDancing){
    this.dancing = isDancing;
  },

  setDancing = function(isDancing) {
    this.dancing = isDancing;
  }
});

var p = new Person();

$('#id').click(function() {
  p.setDancing.call(p, NEWVALUE);
  // 'this' will point to 'p' in the function 'p.setDancing'
});

```
By adding this method, you can do the trick

```
addHandler: function() {
    var self = this;
    $('#id').click(function() {
      // self now points to this
    });
}

```