title: Javascript 'this' pointer in jQuery
body: <p>I've created an object <code>obj</code>: </p>
  
  <pre><code>function a(id, ...){
     this.id = id;
     ......
  }
  </code></pre>
  
  <p><code>var obj = new a("#somediv", ...);</code></p>
  
  <p>and I have this function:</p>
  
  <pre><code>a.prototype.b = function(){
      $(this.id+" span").mouseover(function(){
          $(this.id).addClass("c");
      });
  
  };
  </code></pre>
  
  <p>Apparently, the <code>this</code> in the mouseover function points to the <code>span</code> instead of <code>obj</code>... </p>
  
  <p>I know I can solve this problem by creating a variable and getting the property of <code>this.id</code> but</p>
  
  <p><strong>is there a way to make the <code>this</code> in the mouseover function point to <code>obj</code> instead?</strong></p>