Hello everyone,

I was wondering if javascript eventlistener works with methods. Let me explain what I am trying to do.

I know that we can do following in javascript.

var something = document.getElementById("....");
something.addEventListener("click", someFunction, false);

function someFuntion(evt)
{
    ...........................
    ...........................
    ...........................
}

Now what if someFunction() is a method of some class. So that it looks like this.

function someClass()
{
     function someFunction(evt)
     {
          ...........................
          ...........................
          ...........................
     }
}

what changes do I need to make in my addEvenListener to call this method? Is it implemented in javascript or not?

Thanks in advance,
Irfan Ali

Reply via email to