OK, lets make this easy . I wont go into details of my function, I would like to first see it work . So here's the thing:
I've read a small tutorial about addEventListener but it doesn't work for me. So what I want is this (well, that's not exactly what I want but I just want to know the concept first):
I have an image. I want when you click on it two alerts appear. Like this:
<img onclick="alert('a'); alert('b');">
But I don't want to do it thusly. I want to make it dynamically. So:
and then something like:
but don't know the rest.
How to solve this?