为什么我把<script></script>改到head中就不显示结果了?
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>document.getElementById</title>
<script type="text/javascript">
var mychar= document.getElementById("con").innerHTML ;
document.write("结果:"+mychar); //输出获取的P标签。
</script>
</head>
<body>
<p id="con">JavaScript</p>
</body>
</html>