[Project_owners] [JS] addEventListener function parameter

Michael Bar-David mbd1987 at gmail.com
Tue May 30 21:17:24 EDT 2006


OK...  the joy was premature. I steel have problems (probably I didn't
understand how to use it correctly).
I'm trying to dynamically add buttons to the page, and giving them numbers:
when clicking button1 it should use a function, and give it 1 as
parameter, the second is button2, an should pass 2 as parameter, and
so on.
this code make problems (I can't define what):

button.addEventListener('click', function (){ foo(ixyzt)}, 'false');
ixyzt++;

(ixyzt is a global variable)

thanks
Michael


More information about the Project_owners mailing list