title: error: Uncaught TypeError: Cannot set property 'innerHTML' of null
body: <p>I keep on getting the error "Uncaught TypeError: Cannot set property 'innerHTML' of null" when I try to run this program in chrome. I do not now what I am doing wrong, and and any help would be appreciated.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;script&gt;
      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 = "&lt;embed src=\""+file+"\"hidden=\"true\"autostart=\"true\" loop=\"false\"/&gt;";
  
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form name="form1"&gt;
  &lt;input type="button" id="button" value="click" onClick="thing('sound.mp3')" /&gt;
      &lt;input type="text" id="text" value="hey" /&gt;
  &lt;/form&gt;
  &lt;div id="sound"&gt;
  &lt;p&gt;
  &lt;/p&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>