HTML文件
<!--
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/test.css">
</head>
<body>
<h1>这是标题 1</h1>
<h2>这是标题 2</h2>
<p>这是段落</p>
<p class="no2">这个段落设置了内边距。</p>
</body>
</html>
-->
<!DOCTYPE html>
<html>
<body>
<h1>My Web Page</h1>
<p id="demo">A Paragraph.</p>
<button type="button" onclick="myFunction()">点击这里</button>
<p><b>注释:</b>myFunction 保存在名为 "myScript.js" 的外部文件中。</p>
<script type="text/javascript" src="js/myScript.js"></script>
</body>
</html>
CSS文件
h1 {color: red}
p {color: blue}
JavaScript文件
function myFunction()
{
document.getElementById("demo").innerHTML="My First JavaScript Function1";
}