<script type="text/javascript"> // 这行代码输出标题: document.write("<h1>This is a header</h1>"); // 这行代码输出段落: document.write("<p>This is a paragraph</p>"); document.write("<p>This is another paragraph</p>"); </script>
2、多行注释
多行注释以 /* 开头,以 */ 结尾
<script type="text/javascript"> /* 下面的代码将输出 一个标题和两个段落 */ document.write("<h1>This is a header</h1>"); document.write("<p>This is a paragraph</p>"); document.write("<p>This is another paragraph</p>"); </script>