JS What's the difference between x.onclick and x.addEventListener() ? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 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
1 Antwort
+ 4
1st Aug 2019, 5:51 AM
Gordon
Gordon - avatar