title: Set JSON object value from Dropdown and text input
body: <p>I have this dropdown in my HTML next to a text box and a button.</p>
  
  <p>What I want to happen is the user selects something from the dropdown. Then they input a number in the box. When they click save, it takes that number, and assigns it to the coordinating location in the JSON object for the item they selected from the drop down.</p>
  
  <p>Here is kind of what I have so far. The commented out line is what I want to happen at that spot. Not sure how to code it.</p>
  
  <p><a href="https://jsfiddle.net/tq4xL0xs/" rel="nofollow noreferrer">https://jsfiddle.net/tq4xL0xs/</a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var userIngredients = {
      Acorn:0,
      Apple:0,
      Armoranth:0,
      BigHeartyRaddish:0};
      
      
      function setUserAmountToVariables()
  {
  
      var tempNumber =  document.getElementById("itemInput").value;
  
      var tempItem = document.getElementById("dimeADozen");
  
  
  //set tempnumber to whatever the user selected as the item from the dropdown (in useringredients object)
  
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;select id="dimeADozen"&gt;
      &lt;option data-value="userIngredients.Acorn"&gt;Acorn&lt;/option&gt;
      &lt;option value=userIngredients.Apple&gt;Apple&lt;/option&gt;
      &lt;option value=userIngredients.Armoranth&gt;Armoranth&lt;/option&gt;
      &lt;option value=userIngredients.BigHeartyRaddish&gt;Big Hearty Raddish&lt;/option&gt;  
  &lt;/select&gt;
  &lt;input type="number" id="itemInput" min="0" max="99999"&gt;
  &lt;button onclick="setUserAmountToVariables();"&gt;Save Ingredient&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>