ChrisB: JS-Variable in onclick-Ereignis einfügen?

Beitrag lesen

Hi,

x.i = i;
x.onclick = function(){alert(this.i);}

Das ist eine Möglichkeit, Closures wären eine weitere.

MfG ChrisB

--
“Whoever best describes the problem is the person most likely to solve the problem.” [Dan Roam]