When I think about HTML, I like to think about communication. A television personality looks a certain way, and that helps communicate. Her voice says the words, but her head (and hairstyle) add an important element--you can see who is talking.

Similarly, a main purpose of HTML is to give voice to your words and place to your pictures. But there are also macros--heads and smiles and such--which we can use to help ourselves do more than talk--to actually communicate.

A friendly hello

<head>
<title>Hi</title>
</head>

<body>
<p>Hello!</p>
</body>

Hello!

The first two things to mention are named head and body--as illustrated above. Think of the body as being where things are, and the head as where their names go.

A rocket launch

<script type="text/javascript">
function blastoff(time) {
var count = '';
while (time > 0) count += time-- + '... ';
return count + '0! Blastoff!';
}
document.write(blastoff(10));
</script>

The script element is another one of the macro parts of webpages. Unlike text to be read, you don't ordinarily see the script, which can provide special hidden functions to the webpage.

A nice little tax form

<form action="foobar">
<p>How soon do you want the IRS to blow up?</p>
<p>Launch a rocket in:
<input type="text" name="time" size="3" value="10" />
second(s)</p>
<p><input type="button" value="Go!"
onclick="alert(blastoff(parseInt(time.value)%1000||0))" /></p>
</form>

How soon do you want the IRS to blow up?

Launch a rocket in: second(s)

In fact, you can use the forms to do things in entirely different ways. This form uses a button "Go!" to run its own version of the blastoff() function.