Comments in CSS are typically used to explain the purpose of the style rules declarations. It will help you and others to understand what you were trying to do with the style rules at the time of editing style sheets. Comments are not displayed by the browsers.
Single-line comments
JavaScript single line comment begins with //, See the example below:
<script>
function helloWorld(){
alert("Hello World!"); // alert "Hello World!" in the browser
}
</script>
Multi-line comments
JavaScript multiple line comment begins with /*, and ends with */.
<script>
/*
The function below display
an alert dialog with "Hello World!" message
*/
function helloWorld(){
alert("Hello World!");
}
</script>
Use the syntax
"// text"and"/* text */"Comments in CSS are typically used to explain the purpose of the style rules declarations. It will help you and others to understand what you were trying to do with the style rules at the time of editing style sheets. Comments are not displayed by the browsers.
Single-line comments
JavaScript single line comment begins with
//, See the example below:Multi-line comments
JavaScript multiple line comment begins with
need an explanation for this answer? contact us directly to get an explanation for this answer/*, and ends with*/.