(PCC)::[How-Single-line-comment-to-prevent-execution-in-JavaScript]::[js]
<!DOCTYPE html> <html> <body> <h2>JavaScript Comments</h2> <h1 id="myH"></h1> <p id="myP"></p> <script> //document.getElementById("myH").innerHTML = "My First Page"; document.getElementById("myP").innerHTML = "My first paragraph."; </script> <p>The line starting with // is not executed.</p> </body> </html>
The line starting with // is not executed.