HTML and CSS Reference
The HTML <form> tag contains an input tag with three attributes: type , value , and
handler called onClick. The onClick event handler is assigned a function called “wake-
UpCall()” . When the user clicks the button labeled Wake me , a click event occurs, the
onClick event handler is triggered, and the wakeUpCall() function will be executed, as
demonstrated in Example 13.1 and shown in Figure 13.1.
<head> <title>Wake up call</title>
// Function is defined here
setTimeout('alert("Time to get up!")',5000);
<script></script> tags. When the user clicks the form button, the function assigned
to the event handler is called; that is, wakeUpCall() is called. The function itself is
The timer is set for 5,000 milliseconds. The alert dialog box will pop up on the
screen 5 seconds after the user clicks the button.
End of the HTML <head> tag.
This is the start of an HTML <form> tag.
The type of form uses a “button” input type.
The value is shown in the button as the text, “Wake me” .
The onClick event is assigned the name of a function. When the user clicks the
button, the onClick event handler, wakeUpCall() , will be called.