xxxxxxxxxx
<html>
<head>
<meta charset="utf-8">
<title>高手教程(study.p2hp.com)</title>
</head>
<body>
<p id="demo">单击按钮改HTML文档添加一个注释</p>
<button onclick="myFunction()">点我</button>
<script>
function myFunction(){
var c=document.createComment("My personal comments");
document.body.appendChild(c);
var x=document.getElementById("demo");
x.innerHTML="这个文件现在包含一个注释,但如你所知,注释是看不见的。";
};
</script>
</body>
</html>