document.write("Hello world");
这个 JavaScript 语句告诉浏览器向网页输出 "Hello world"。
eg:
代码块以左花括号开始,以右花括号结束。
代码块的作用是一并地执行语句序列。
<script >
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>