Single Line and Multi-Line Comments in PHP, HTML, CSS, and JavaScript
Single Line and Multi-Line Comments in PHP, HTML, CSS, and JavaScript
Let’s start with the tutorial of Single Line and Multi-Line Comments in PHP, HTML, CSS, and JavaScript”.
Single-Line Comment in PHP
Let’s see the “Single-Line Comment in PHP”.
1 2 3 |
<?php // This is a single line comment in PHP. ?> |
Multi-Line Comment in PHP
Let’s see the “Multi-Line Comment in PHP”.
1 2 3 4 5 6 7 |
<?php /* This is Multi-line - Line 1 Comment This is Multi-line - Line 2 Comment */ echo “I am super awesome!”; ?> |
Comments in HTML
Let’s see the “Comments in HTML”.
1 2 3 4 5 6 7 8 9 10 11 12 |
<html> <head> <title>This is Multi line Comment</title> </head> <body> <!-- This is Multi-line - Line 1 Comment This is Multi-line - Line 2 Comment This is Multi-line - Line 3 Comment --> </body> </html>
|
Comments in CSS
Let’s see “Comments in CSS”.
1 2 3 4 5 6 7 8 |
body { font-size: 32px; width:30px; height:90px; /* CSS Comments */ } |
Single line comments in JavaScript
Let’s see the “Single line comments in JavaScript”.
1 2 3 4 5 6 |
<script> var a = 5; // Declare x, give it the value of 5 var b = a + 2; // Declare y, give it the value of x + 2 // Write y to demo: document.getElementById("demo").innerHTML = y; </script> |
Multi-Line Comments in JavaScript
Let’s see the “Multi-line comments in JavaScript”.
1 2 3 4 5 6 |
/* This is multi-line comment - Line 1 This is multi-line comment - Line 2 */ document.getElementById("t4tutorials").innerHTML = "Welcome to first page."; document.getElementById("t4tutorials").innerHTML = "Welcome to 2nd page."; |