title: how to bind array data to select option
body: <p>i have array data it call "provinsi" i got array on console like normal array </p>
  
  <p>here's my code </p>
  
  <pre><code> &lt;select id="select"&gt;
        &lt;option value="default"&gt;default&lt;/option&gt;
   &lt;/select&gt;
   &lt;script&gt;
          console.log(provinsi)
          var select = document.getElementById("select");
  
          for(var i = 0; i &lt; provinsi.length; i++)
          {
              var option = document.createElement("option"),
                  txt = document.createTextNode(provinsi[i]);
              option.appendChild(txt);
              option.setAttribute("value",provinsi[i]);
              select.insertBefore(option,select.lastChild);
          }
      &lt;/script&gt;
  </code></pre>
  
  <p>but i got result like this 
  <a href="https://i.stack.imgur.com/eiUZl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eiUZl.png" alt="enter image description here"></a></p>
  
  <p>here's my console "provinsi"
  <a href="https://i.stack.imgur.com/E2CFY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/E2CFY.png" alt="enter image description here"></a>
  any suggest ? thanks before </p>