DevX JS - W2C5 - Events
DevX JS - W2C5 - Events
Events
Review
Review
● DOM: Document Object Model ● DOM (continued)
○ DOM Manipulation ○ DOM Creation (.innerHTML)
○ DOM Selection (getElementById, etc) ○ DOM Creation (.createElement)
○ DOM Editing & HTMLCollections ○ DOM Deletion
(arraylike) ● Why Code? Solving Problems Long-Term
○ DOM Editing & loops (for vs for-of) ● Breaking Down Problems
Events
Events
Events
1. Open any webpage, then open the
console.
2. In the console, type:
a. monitorEvents(window);
b. press enter
3. Move your mouse over the screen.
What do you see?
4. Open any event object. What do you
see?
Event Listeners
Event Listeners
Event Listeners are a fundamental part of front-end programming.
Basically your code watches for an event to happen, then runs a function.
I think the most useful ones (that you should focus on for now) are:
</script>
Event Object
The event object contains all the information you would want to know about the event that just
happened: Which event, which element, when, coordinates on page, etc…
1. Click Here
2. See this
Event Object
Event Object
The most useful parts of the event object (that I can think of):