function is defined in the
<head> of this document, and called
It would be better style to define the
The following example is more complex. It uses an HTML
input and output data, does some validity checking, and displays an alert box
for invalid entries.