为什么结果是这样的?大神
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<h2 id ="x">hello </h2>
<script type="text/javascript">
var name = document.getElementById("x");
document.write("原标题:"+name.innerHTML+"<br>");
name.innerHTML = "LOL";
document.write("修改后的内容:"+ name.innerHTML);
</script>
</body>
</html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<h2 id ="x">hello </h2>
<script type="text/javascript">
var name = document.getElementById("x");
document.write("原标题:"+name.innerHTML+"<br>");
name.innerHTML = "LOL";
document.write("修改后的内容:"+ name.innerHTML);
</script>
</body>
</html>