Por que document.body é nulo no meu javascript?

qui está o meu breve documento HTM

Por que o Console do Chrome está notando este erro:

"TypeError não capturado: não é possível chamar o método 'appendChild' denull "?

<html>
<head>
    <title>Javascript Tests</title>

    <script type="text/javascript">

        var mySpan = document.createElement("span");
        mySpan.innerHTML = "This is my span!";

        mySpan.style.color = "red";
        document.body.appendChild(mySpan);

        alert("Why does the span change after this alert? Not before?");

    </script>
</head>
<body>

</body>
</html>

questionAnswers(12)

yourAnswerToTheQuestion