I want to call a "member" function from a class when an onclick event is fired. The onclick event itself should be bound inside the class. This is what I have:
var MyClass = function()
{
this.value = 'hello';
this.update = function()
{
console.log(this.value);
// Do some things with this.value
};
$('#button').click(this.update);
};
The browser complaints in the update function that this.value is undefined.