JavaScript DHTML/Language Basics/Comments
Styles of JavaScript Comments
// I"m a single-line comment
// This is another comment
/* Real multiple-line comment to follow */ //Yet another comment
/**************************************************************
* JavaScript module written by Harold Davis
* Purpose: Rock, Scissors, and Paper game
* Date:
* Inputs:
* Outputs:
* Of special note: Demonstrates conditional statements
**************************************************************/
Using JavaScript Comments
<html>
<head>
<title>Using JavaScript comments</title>
</head>
<body>
<script language="JavaScript">
<!-- Begin hiding JavaScript
// document.write("hello world!")
/* document.write("Hello world!")
document.write("Hello World!") */
document.write("HELLO WORLD!")
// End hiding Javascript -->
</script>
</body>
</html>
Using JavaScript Comment Tags
<html>
<head>
<title>JavaScript Unleashed</title>
</head>
<body>
<script type="text/javascript">
<!--
// Variables
var firstName = "Jon";
var lastName = "Simpson";
var internetAddress = "jsimpson@company.ru";
/*------------------------------------------
Display the user"s first and last name along with their e-mail address.
------------------------------------------*/
// Combine three strings
document.writeln(firstName + " " + lastName + "<br>");
document.writeln("e-mail address: " + internetAddress);
// -->
</script>
</body>
</html>