title: HTML5 Slider with onchange function
body: <p>I have a slider (input type range) that is supposed to run a function when the value is being changed. The function should then display the new value in a separate div container. After placing an alert in the function, I know that the function isn't being called, but after googling for an hour and trying a few different methods I just can't find the error.</p>
  <p>Here's the HTML part:</p>
  <pre><code>&lt;input id=&quot;slide&quot; type=&quot;range&quot; min=&quot;1&quot; max=&quot;100&quot; step=&quot;1&quot; value=&quot;10&quot; onchange=&quot;updateSlider(this.value)&quot;&gt;
  
  &lt;div id=&quot;sliderAmount&quot;&gt;&lt;/div&gt;
  </code></pre>
  <p>JavaScript:</p>
  <pre><code>// Slider
  function updateSlider(slideAmount)
  {
    alert(&quot;error&quot;);
    var sliderDiv = document.getElementById(&quot;sliderAmount&quot;);
    sliderDiv.innerHTML = slideAmount;
  }
  </code></pre>