title: Issue with my random number generator
body: <p>I want to create a random number generator where you enter the min and max values. However, when I enter in let's say 0 as the min and 100 as the max I get value like 270, 690, 180, 580, 70, 240, etc. </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>function random_number(min, max) {
    max = $("#max_num").val();
    min = $("#min_num").val();
    document.getElementById("random_num").innerHTML = Math.floor(Math.random() * (max - min)) + min;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;p&gt;Enter max number: &lt;input type="text" id="max_num"&gt;&lt;br/&gt; Enter min number: &lt;input type="text" id="min_num"&gt;&lt;br/&gt;
    &lt;button type="button" onclick="random_number()"&gt;Random number&lt;/button&gt;&lt;br/&gt;
    &lt;div id="random_num"&gt;&lt;/div&gt;
  &lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>