Using the alert() Method

alert() is the easiest of the three methods to use. You can use it to display textual information to the user in a simple, concise way. When the user is finished reading the message, she simply must click OK to get rid of it.

First, open your template HTML page in your favorite text editor and save it with a new name in a convenient location on your hard drive:

<html>
<head>
<title>A Simple Page</title>
<script language="JavaScript">
<!-- Cloaking device on!

// Cloaking device off -->
</script>
</head>
<body>

</body>
</html>

NOTE

Remember to save it with the file extension HTM or HTML; otherwise, things won't work as planned.

WARNING

At this stage, it is probably worth knowing that JavaScript is a case-sensitive language. ...

Get JavaScript™ 1.5 by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.