Summary
In this chapter, we have dealt with quite a few topics to increase the interactivity of web pages. We saw the different ways to specify events and then we dived into some different event handlers in more detail. The onload event handler gets fired when the element it was specified on, often the document
object, is fully loaded. This is great to wrap other functionality in, because it avoids selecting DOM content that is not there yet.
We also saw the mouse event handlers, for responding to all the different things that can be done with a mouse on a web page. The use of all these event handlers is very similar, but they each enable a different type of interaction with the user. We also saw that we can access the element that fired an event by calling event.target
. This property holds the element that fired an event.
We also dived into onchange
, onblur
, and the key event handlers in more detail. After that, we saw how to trigger interaction when forms...