Listening to Events
GiandoDev
Posted on April 24, 2020
The events allow us to listen for something inside our D.O.M.
Here is the list of all avaible events (MDN)
that we can listen to.
In the gif down below we see the snippet of code in action.
When the button is clicked the addEventListener perform the action, in this case we add or remove the class red to our button (element).
There is also the event object but we talk about it later and more in depth.
💖 💪 🙅 🚩
GiandoDev
Posted on April 24, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.