title: passing option value in html as javascript parameter
body: <p>I made a simple html and javascript file to help me roll dice in DND. Currently this seems to be working fine</p>
  
  <p>index.html</p>
  
  <pre><code>  &lt;form&gt;
      &lt;input type="number" id="diceType"&gt; dice type (d20, d12 ect ...)&lt;br&gt;
      &lt;input type="number" id="diceNumber"&gt; number of dice&lt;br&gt;
      &lt;input type="number" id="mod"&gt; mod&lt;br&gt;
    &lt;/form&gt; 
    &lt;button type="button" onclick="roll(document.getElementById('diceType').value, document.getElementById('diceNumber').value, document.getElementById('mod').value)"&gt;
   Roll
   &lt;/button&gt;
  </code></pre>
  
  <p>index.js</p>
  
  <pre><code>const roll = function(diceType, diceNumber, mod){
    let total = 0;
    let div1 = document.getElementById("rolling");
    div1.innerHTML = '';
    for(let i = 0; i &lt; diceNumber; i++){
      let roll = Math.floor(Math.random() * (diceType - 1 + 1) ) + 1;
      total += roll;
      div1.innerHTML += 'you rolled ' + roll + "&lt;br&gt;";
    }
    let result = parseInt(total) + parseInt(mod);
      document.getElementById("youRolled").innerHTML =
    'You rolled ' + diceNumber + 'D' + diceType + ' modifier was ' + mod + ' total: ' + result
  };
  </code></pre>
  
  <p>However, I find this a little clunky as I want to have a selection drop down list, have the user select the option, then pass that as a parameter to the roll function.</p>
  
  <p>I have tried using </p>
  
  <pre><code>&lt;select&gt;
    &lt;option value="100"&gt;D100&lt;/option&gt;
    &lt;option value="20"&gt;D20&lt;/option&gt;
    &lt;option value="12"&gt;D12&lt;/option&gt;
    &lt;option value="10"&gt;D10&lt;/option&gt;
    &lt;option value="8"&gt;D8&lt;/option&gt;
    &lt;option value="6"&gt;D6&lt;/option&gt;
    &lt;option value="4"&gt;D4&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>I have tried a few things but I was wondering how would I access say</p>
  
  <pre><code>&lt;option value="12"&gt;D12&lt;/option&gt;
  </code></pre>
  
  <p>that value then pass it into </p>
  
  <pre><code>onclick="roll()"
  </code></pre>
  
  <p>as one of the parameters. That why I figure it would prevent me or others from selecting a million different dice combinations to enter. Also, I do know there is other generators out there, but was looking to try and make my own for fun. </p>