This JavaScipt prompts you for your name, and writes a greeting to you in the document.
This code should be placed between the HEAD tags of the page:
<SCRIPT LANGUAGE="JavaScript">
<!---------- JavaScript begins...
var Name = prompt ("Please enter your name","");
if ((Name == "") || (Name == null)) {
Name = "WebSurfer";
}
// JavaScript ends ---------->
</SCRIPT>
This code should be placed where you want to show the greeting:
<SCRIPT LANGUAGE="JavaScript">
<!---------- JavaScript begins...
document.writeln ("<CENTER><H3>Greetings, " + Name + "</H3></CENTER>");
// JavaScript ends ---------->
</SCRIPT>