title: not found error: DOM exception 8
body: <p><li>I am dynamically creating a select input with options. After the select input is created I assign it to a listitem(newli) like so:</p>
  
  <pre><code>   newli.innerHTML =  dynamicDropDown;
  </code></pre>
  
  <p><li>Then I insert that listitem(newli) into my form like so:</p>
  
  <pre><code>  newli.insertBefore('#priceContainer');
  </code></pre>
  
  <p><li>I get error DOM exception 8
  (The code initially inserted my select input even though I was receiving this error, but now that I am calling these functions as part of a for loop; the select input is not being appended and the loop is only executing once) let me know if any more code would help. Thank you. p.s. #pricecontainer is the id of a list item in my form.</p>
  
  <p>Complete Code:</p>
  
  <pre><code>        newli = document.createElement('li');
          var dynamicDropDown = '';
          dynamicDropDown="&lt;select&gt;";
              for(j=0; j&lt;choiceArray.length; j=j+1){
                  dynamicDropDown+= "&lt;option value='"+choiceArray[j]+"'&gt;"+choiceArray[j]+"&lt;/option&gt;";
              }
          dynamicDropDown += "&lt;/select&gt;";
          newli.innerHTML =  dynamicDropDown;
          newli.insertBefore('#priceContainer');
  </code></pre>