Sorry for my english. Here is example code:
/**
* @constructor
*/
function MyNewClass(){
this.$my_new_button = $('<button>Button</button>');
this.my_value = 5;
this.init = function (){
$('body').append(this.$my_new_button);
this.$my_new_button.click(
function (){
// Its always alerts "undefined"
alert(this.my_value);
}
)
}
}
How can i access objects my_value
property inside jQuery click event function?
Is it possible?