G
gert
obj=function()
{
this.attribute=1
this.method=function()
{
img=document.createElement('img')
img.onclick=function
{
this.attribute=2 // i need the obj this not the img this
}
document.body.appendChild(img)
}
}
obj1=new obj()
obj1.method()
Anybody know how to set the obj1 atribute by clicking on a the image ?
{
this.attribute=1
this.method=function()
{
img=document.createElement('img')
img.onclick=function
{
this.attribute=2 // i need the obj this not the img this
}
document.body.appendChild(img)
}
}
obj1=new obj()
obj1.method()
Anybody know how to set the obj1 atribute by clicking on a the image ?