+ 2

JS What's the difference between x.onclick and x.addEventListener() ?

I was just working on a code and in the js, I had x.onclick, but didn't work. But it worked when I did it through addEventListener(). So what really is the difference ?

1st Aug 2019, 5:01 AM
Ginfio
Ginfio - avatar
2 Answers
+ 4
1st Aug 2019, 5:51 AM
Gordon
Gordon - avatar