Single line comments : Comments « Language Basics « JavaScript Tutorial






The // comment tag enables comments to be placed between the // and the end of the line.

<html>
<head>
<title>A Simple Page</title>
<script language="javascript">
<!--
// The first alert is below
alert("An alert triggered by JavaScript!");
// Here is the second alert
alert("A second message appears!");
//  -->
</script>
</head>
<body>

</body>
</html>








1.1.Comments
1.1.1.Single line comments
1.1.2.Multiline comments
1.1.3.Hide scripts using comments