这段代码有什么问题为什么总是运行不成功呢?求解
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <title></title> </head> <body> <p id="imooc1"></p> <p id="imooc2"></p> <script type="text/javascript"> var mychar=document.getElementById("imooc1"); mychar.innerHTML = "您好!"; document.write(mychar.innerHTML); mychar.style.color = "red"; } </script> </body> </html>