2009-11-15 13:32:27| 分类: javascript | 标签: |举报 |字号大中小 订阅
0006:JavaS
<html>
<body>
<script type="text/javas
document.write("<h1>这是标题</h1>");
document.write("<p>这是段落。</p>");
document.write("<p>这是另一个段落。</p>");
</script>
</body>
</html>
0007:JavaS
<html>
<body>
<script type="text/javas
{
document.write("<h1>这是标题</h1>");
document.write("<p>这是段落。</p>");
document.write("<p>这是另一个段落。</p>");
}
</script>
</body>
</html>
0008:JavaS
<html>
<body>
<script type="text/javas
// 这行代码输出标题:
document.write("<h1>这是标题</h1>");
// 这行代码输出段落:
document.write("<p>这是段落。</p>");
document.write("<p>这是另一个段落。</p>");
</script>
</body>
</html>
0009:JavaS
<html>
<body>
<script type="text/javas
/*
下面的代码将输出
一个标题和两个段落
*/
document.write("<h1>这是标题</h1>");
document.write("<p>这是段落。</p>");
document.write("<p>这是另一个段落。</p>");
</script>
</body>
</html>
0010:使用单行注释来防止执行
<html>
<body>
<script type="text/javas
document.write("<h1>这是标题</h1>");
document.write("<p>这是段落。</p>");
//document.write("<p>这是另一个段落。</p>");
</script>
</body>
</html>
0011:使用多行注释来防止执行
<html>
<body>
<script type="text/javas
/*
document.write("<h1>这是标题</h1>");
document.write("<p>这是段落。</p>");
document.write("<p>这是另一个段落。</p>");
*/
</script>
</body>
</html>
评论