Obviously 'this' is mText object
But why it does not work if I replace
this.title
with:
arr[i]
or
mText.title
? (otherobject on click gets allways the vallue of arr[0])
Code:
//do - it loops through arreay of values
var mText = d.createElement("div");
mText.title = arr[i];
mText.onclick = function()
{
otherobject.title = this.title;
};
mContainer.appendChild(mText);
//loop
Hope this makes sence.