<html>
<head>
<title>document.write() Example</title>
</head>
<body>
<p>The current date and time is:
<script type="text/javascript">
//写入文档
document.write("<strong>" + (new Date()).toString() + "</strong>");
//方法open()和close()分别用于打开和关闭网页的输出流。如果有了write()和writeln(),
就不需要这两个方法
</script>
</p>
</body>
</html>