Comments can be added to explain the JavaScript, or to make it more readable
Single line comments start with//.
Multi line comments start with/*and end with*/.
This example uses a multi line comment to explain the code:
<html> <head>
<script type = “text/javascript”>
//this is a single line comment
/*
The code below will write
One header and two paragraphs */
Document.write (“<h1>This is a header</h1>”);
Document.write(“<p> This is a paragraph </p>”);
Document.write(“<p>This is another paragraph</p>”);
</script>
</head>
<body> </body>
</html>
Related Posts:
5.2 JavaScript Comments
Comments can be added to explain the JavaScript, or to make it more readable
Single line comments start with//.
Multi line comments start with/*and end with*/.
This example uses a multi line comment to explain the code:
Related Posts: