Hi there,

I'm sure a lot of us here had this problem, but I can't seem to find the solution anywhere on the net. I am trying to add an event to an object dynamically like this.

HTML Code:
myObject.addEventListener("click", eventHandler, false) ;

function eventHandler()
{
     alert("Hello") ;
}
I know that the above will only work on Geko browsers and for IE, I will have to use attachEvent instead of addEventListener. However, my question is how can I pass one or more arguments to the eventHandler function. From my research, and testing, the function eventHandler will accept only one argument and it is always the event itself. How could I resolve this?

I guess, the javascript clousure could solve this, but I'm still trying to learn it.

Your help is much appreciated. Thanks a lot.