I want to write a code which will add 1 to the object value on button click where button ID is the same as name in object (I will write function to dynamically add new positions in object). I hope you understand what I am talking about. I'm not English native speaker.. :)
I have this code (in first alert i want to get "99" and "100" in second but it doesn't work when I use this.id):
var obj = {mybuttonid: 99};
$('button').click(function () {
alert(obj.this.id);
obj.this.id++;
alert(obj.this.id);
});