title: How can i get the drop down selected values and form an number
body: <p>Here i have a 3 drop-down list which holds number ranging from 0 to 9, this is actually for the cost input.for example if i select <code>4</code> in 1st dropdown and <code>5</code>in second dropdown and <code>0</code> in third dropdown, then the cost should be 450. now what i am trying to do is, Once i input the values and click submit,i should capture the value 450 in one variable and convert it to integer. How can i do that?</p>
  
  <p>here's what i have tried</p>
  
  <pre><code>&lt;select id="cost1" class="cost-block-add"&gt;
      &lt;option value="0"&gt;0&lt;/option&gt;
      &lt;option value="1"&gt;1&lt;/option&gt;
      ...  
  &lt;/select&gt;
  
  &lt;select id="cost2" class="cost-block-add"&gt;
      &lt;option value="0"&gt;0&lt;/option&gt;
      &lt;option value="1"&gt;1&lt;/option&gt;
      ...
  &lt;/select&gt;
  
  &lt;select id="cost3" class="cost-block-add"&gt;
      &lt;option value="0"&gt;0&lt;/option&gt;
      &lt;option value="1"&gt;1&lt;/option&gt;
      ...
  &lt;/select&gt;
  
  &lt;button class="submit-button minimal-padding" onclick="getCost()"&gt; submit &lt;/button&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>function getCost(){
      var str;
      var num_arr = [];
      var elems = document.querySelectorAll('.cost-block-deduct');
      elems.forEach(function(el){          
          var nums = el.options[el.selectedIndex].text                
          num_arr.push(nums)
      })
  }   
  </code></pre>