JavaScript中可以通过/* */来表示多行注释,注释内的代码不起任何作用
<!DOCTYPE html> <html> <body> <h1 id="myH1"></h1> <p id="myP"></p> <script> /* The code below will write to a heading and to a paragraph, and will represent the start of my homepage: */ document.getElementById("myH1").innerHTML="Welcome to my 75271.com"; document.getElementById("myP").innerHTML="This is my first paragraph."; </script> <p><strong>Note:</strong> The comment-block is not executed.</p> </body> </html>