代码不是按照顺序依次执行吗?为什么<p id="con">Hello world!</p>这一行结果输出的却是"New text!"?谢谢告知。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<p id="con">Hello world!</p>
<script>
var mycon=document.getElementById("con");
document.write("P标签原始内容为"+mycon.innerHTML+"<br/>");
mycon.innerHTML="New text!";
document.write("P标签修改内容为"+mycon.innerHTML);
</script>
</body>
</html>