From the course: JavaScript Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Practice: Experiment with event listeners

Practice: Experiment with event listeners - JavaScript Tutorial

From the course: JavaScript Essential Training

Start my 1-month free trial

Practice: Experiment with event listeners

- There are so many different Dom events to listen to, and there is literally no limit other than your imagination to what you can do with an event listener when an event is triggered. In this practice example, I want you to just dive headfirst into event listeners and events to explore what events success, and what you can do with them. In the practice files, I've set up a grid for you to play around with. You can listen for events on the grid as a whole to individual cells in the grid, or just do something entirely different. It is entirely up to you. Nevertheless, here are some suggestions on what you can try out if you want to. Use an event listener to add CSS, either inline or through an added class to draw highlight around the entire grid when you hover over it and then take the highlight away when you move your mouse out. Add an event listener to each grid cell to highlight that cell when you hover your mouse…

Contents