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 - JavaScript Tutorial
From the course: JavaScript Essential Training
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
-
-
(Locked)
DOM events explained1m 41s
-
(Locked)
Typical DOM events5m 35s
-
(Locked)
Event listeners5m 45s
-
(Locked)
Practice: Experiment with event listeners1m 32s
-
(Locked)
Advanced event listeners and "this"6m 12s
-
(Locked)
Pass arguments through event listeners4m 53s
-
(Locked)
Challenge intro: Create an event listener2m 15s
-
(Locked)
Solution: Create an event listener6m 16s
-
(Locked)
-
-