title: Does innerHTML Work Across Different Lines?
body: <p>I'm trying to use innerHTML to create a drop list from the user's input, but it doesn't work. The code below outputs an empty drop list. The problem seems to be splitting up the <code>&lt;select&gt;</code> and <code>&lt;option&gt;</code> writes on separate lines. If I put the <code>&lt;select&gt;</code> and <code>&lt;/select&gt;</code> inside the for loop, it works, but it creates a separate drop list for every item. Any ideas?</p>
  
  <pre><code>document.getElementById('text').innerHTML += "&lt;select&gt;";
  for (ddNum=0; ddNum &lt;= ddWanted; ddNum++)
  {
  var ddIDvar = document.getElementById('inputID' + ddNum);
  document.getElementById('text').innerHTML += "&lt;option&gt;" + ddIDvar.value + "&lt;/option&gt;";
  }
  document.getElementById('text').innerHTML += "&lt;/select&gt;&lt;br /&gt;";
  </code></pre>