błąd: Uncaught TypeError: Nie można ustawić właściwości 'innerHTML' z null [duplikat]

To pytanie ma już tutaj odpowiedź:

'innerHTML': obiekt jest pusty lub niezdefiniowany 1 odpowiedź

Wciąż próbuję uruchomić ten program w chrome, otrzymując błąd „Uncaught TypeError: Cannot set property” innerHTML ”o wartości null”. Nie robię teraz tego, co robię źle, i każda pomoc byłaby doceniana.

<!DOCTYPE html>
<html>
<head>
</head>
<script>
    var x = "hey";
    var counter = 1;
    var button = document.getElementById("button");
    var div = document.getElementById("box");
    var text = document.getElementById("text");
    var sound = document.getElementById("sound");
    var array=[ "thanks for clicking", "keep on clicking", "click one more time", "why do you keep on clicking me?", "stop clicking me!"];
function thing(file){
    var y = array[Math.floor(Math.random() * array.length)];
        if (x == y){
            while (y == x){
                var y = array[Math.floor(Math.random() * array.length)];
        }   
        }
    form1.text.value=y;

    x = y;
sound.innerHTML = "<embed src=\""+file+"\"hidden=\"true\"autostart=\"true\" loop=\"false\"/>";

}
</script>
</head>
<body>
<form name="form1">
<input type="button" id="button" value="click" onClick="thing('sound.mp3')" />
    <input type="text" id="text" value="hey" />
</form>
<div id="sound">
<p>
</p>
</div>
</body>
</html>

questionAnswers(1)

yourAnswerToTheQuestion