Jquery bind() click event in Object oriented design

This is so important for set click event. You can set any event with this way easily.

If you work with Object oriented javascript, you cannot bin click event like that. You need to send “this” like below.
[js]
var Any = {
id: 5,
init: function(){
$("div").bind("click", this, this.click);
},
click: function(self){
//you can use like this
console.log(self.data.id);
}
};
[/js]