HTML and CSS Reference
Figure 15.32 A scrolling marquee continues to print news across the image.
We have been using event handlers like onClick , onSubmit , onMouseOver , throughout
this text. In fact, Chapter 13, “Handling Events,” described in detail all of the different
event handlers and how to use them. They are the oldest and simplest way that is
browser compatible. The following example uses the onClick handler as an attribute of
the button element. When the user clicks the button, the function movePosition() will
<input type="button" value="move text"
But using this type of handler violates the principle of separation of the layers; that
The Scripting Way
grammers to apply properties to any object in the HTML tree. In the following example,
the onLoad event property is applied to the window object so that when the document
has completed loading the function assigned to that object will be triggered. In this
example the background color will be changed to light green. See Chapter 13 for details
if you need to be refreshed on this traditional model for handling events.