<!DOCTYPE html>
<html>
    <head>
        <script>
            var text = document.getElementById("text1");
            text.innerText = "hello world";
        </script>
    </head>
    <body>
        <p id="text1"></p>
    </body>
   
</html>


실행시키면 화면에 hello world가 나타났으면 좋겠는데 이렇게 오류 나네...


Uncaught TypeError TypeError: Cannot set properties of null (setting 'innerText') at <anonymous> (c:\web_programming\test\storagetest.html:6:28)