View Single Post
Old 11-11-2012, 04:22 PM   PM User | #1
BubikolRamios
Senior Coder

 
Join Date: Dec 2005
Location: Slovenia
Posts: 1,876
Thanks: 114
Thanked 76 Times in 76 Posts
BubikolRamios is on a distinguished road
what is this here ?

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.
__________________
Found a flower or bug and don't know what it is ?
agrozoo.net galery
if you don't spot search button at once, there is search form:
agrozoo.net galery search
BubikolRamios is offline   Reply With Quote