title: filled textfield value from select dropdown with split()
body: <p>when i use split() the textfield value is empty, value for textfield from drop down that i need is e.g 15.
  please show me where did i go wrong..
  thanks,</p>
  
  <p>here's the code :</p>
  
  <pre><code>&lt;select name="cmbitems" id="cmbitems"&gt;
      &lt;option value="price1:15"&gt;blue&lt;/option&gt;
      &lt;option value="price2:20"&gt;green&lt;/option&gt;
      &lt;option value="price3:25"&gt;red&lt;/option&gt;
  &lt;/select&gt;
  
  &lt;input type="text" name="txtprice" id="txtprice" onClick="checkPrice()"&gt;
  
  var select = document.getElementById('cmbitems');
  var pecah = select.split(":");
  var hasil = pecah[1];
  
  var input = document.getElementById('txtprice');
  select.onchange = function() {
      input.value = hasil.value;
  }
  </code></pre>