Skip to content
Advertisement

How can I find out which button was clicked?

I’ve got my buttons working right, and I’m a listener to each button like this:

JavaScript

Here as you can see the listener is called, and I want to find out which button I’m clicking. Is there a way to do that?

JavaScript

I need some way to find the button in the array.

Advertisement

Answer

try this

JavaScript
Advertisement