ITSE 1411 Beginning Web
JS Module 1 Discussion Events
Discussion
- Understanding Events
- An event describes an action that occurs (often from the user doing something). For instance,
if you move your mouse over an image or text on a page, that is a mouseover event. Another is
clicking the mouse, a click event. See Table 1-3 on page 36.
- Working with Elements and Events
- When an event occurs, you code to handle that event, which is called an event handler. Most
event handlers have the same name as the event with the word on in front of the name. For
example, the onmouseover event handler responds to the mouseover event. The onclick event
handler responds to the click event.
- There is a window.alert() method that displays an alert on a page. We get these alerts quite
often when your software has updates available. The window.alert() method causes a pop-up
dialog box to display with an OK button. To get the dialog box to close, you need to click
the OK button or the X in the corner of the window to close the box.