HTML and CSS Reference
In-Depth Information
EXPLANATION
1
The function called
verify()
is defined with one parameter, a reference to a
pass-
word
object.
2
If the value of the password box is equal to the string
letmein
, the user is told he
can enter.
3
If the user didn't type in the correct password, he or she will be sent a message in
an alert box.
4
The HTML form named
form1
starts here.
5
The input type is a password box. When the user types something into the box, a
series of dots appears.
6
The
onBlur
event handler function, called
verify()
, is invoked when the user
leaves the box and clicks his or her cursor anywhere else on the page. The purpose
of the handler is to check that the user typed in a correct password.
7
When the user clicks the button, the
onBlur
event handler is triggered. See Figures
11.30 and 11.31.
Figure 11.30
The
password
object.