function someFunc(div,val){ this.obj = div; this.foo = val; var _this = this; $('#'+this.obj).click(function(){ alert(_this.foo); }) }