1 Example(s) of Javascript Comments

Description :

In JavaScript, there are two ways to comment the statements a) // and b) /* */. In our example "commented statements" and "document.getElementById("myP").innerHTML = "My first paragraph.";" are commented out. See the code

Javascript Comments Example - 1
<!DOCTYPE html>

<div id="mydiv"></div>

// commented statements
document.getElementById("mydiv").innerHTML = "My First Page";
document.getElementById("mydiv").innerHTML = "My first paragraph.";

<p><strong>Note:</strong> The comments are not executed.</p>