<html>
<head>
<script language="javascript">
//below JavaScript Lines will be display there result on webpage.
document.write("JavaScript Single Line Comment Example");
document.write("<br>");
document.write("JavaScript Single Line Comment can be use in HEAD or BODY of HTML");
</script>
</head>
<body>
</body>
</html>
Multiple line Comment
<html>
<head>
<script language="javascript">
/*
Now we are explaining Multiple lines Comments in JavaScript
below JavaScript Lines will be display there result on webpage.
*/
document.write("JavaScript Multiple Lines Comments Example");
document.write("<br>");
document.write("JavaScript Multiple Lines Comments can be use in HEAD or BODY of HTML");
</script>
</head>
<body>
</body>
</html>
Single line comment to stop execution
<html>
<head>
<script language="javascript">
document.write("<h1>Heading One</h1>");
//document.write("<h2>Heading Two</h2>");
//document.write("<h3>Heading Three</h3>");
document.write("<h4>Heading Four</h4>");
</script>
</head>
<body>
</body>
</html>
No comments:
Post a Comment