document.write()覆盖HTML内容问题 怎么解决?各位大佬
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>document.write()覆盖HTML内容问题</title>
<script type="text/javascript">
function my()
{
var myarr=new Array(); //定义数组
myarr[0]=80;
myarr[1]=60;
myarr[2]=99;
document.write("第一个人的成绩是:"+myarr[0]+"<br>");
document.write("第二个人的成绩是:"+myarr[1]+"<br>");
document.write("第三个人的成绩是:"+myarr[2]);
}
</script>
<p>这是内容,会被覆盖,怎么办</p>
<input type="button" onClick="my()" value="点击">
</head>
<body>
</html>