title: HTML selected option using JavaScript does not work
body: <p>The following code (in file formBuilder1.js) gives me this error: </p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'appendChild' of null.</p>
  </blockquote>
  
  <p>What can I do to solve this problem?</p>
  
  <pre><code>var medium = ["Luft","Wasser"];
  var selectElement = document.getElementById('Medium');
  for(var i=0;i&lt;2;i++){
      var opt = document.createElement('option');
      opt.innerHTML = medium[i];
      opt.value = medium[i];
      selectElement.appendChild(opt);
  </code></pre>
  
  <p>The HTML code is as follows:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;body&gt;
  
  
  &lt;script src="formBuilder1.js"&gt;&lt;/script&gt;
  
  &lt;select id="Medium"&gt;&lt;/select&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Thanks in advance.  </p>