untitled

(John Hannent) #1
</head>

<body>

<button onclick=”foryou()”>Click me for a personal
message.</button>

</body>
</html>

If you’re sticking to Internet Explorer, you can simplify the code, thus:


<script>

function foryou( ) {
alert(“A message for you!”);
}

</script>

The HTML comment symbols prevent some browsers from
displaying code to the user. (Nothing is commented here — using these
symbols just tricks some browsers into ignoring the code.) Comments are
never displayed, except to the programmer while writing the code. Worse,
the // symbol is a JavaScript comment mark, and you have to stick that in to
prevent JavaScript from getting confused by the HTML -->symbol! Talk about
workarounds. If I were you, I’d just leave out all these comment symbols and
not fret about it. The browsers that don’t recognize the