JavaScript Comments

JavaScript comments can be added to explain the JavaScript script or to make the code more readable.Single line comments start with //. The following example uses single-line comments to explain the code.

<html>
<body>
<script type="text/javascript">
// Write a heading
document.write("<h1>This is a heading</h1>");
// Write two paragraphs:
document.write("<p>This is a paragraph.</p>");
document.write("<p>This is another paragraph.</p>");
</script>
</body>
</html>
Share on Google Plus

About rourn vireak

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment

0 comments:

Post a Comment