input event with input[type="range"]

testing to see if using input event works better than change

by aybalasubramanian

HTML

<div style="margin-top: 1em">
    <h2>Price</h2>
    $0<input id="price" type="range" min="0" max="50000" value="" />$50000
</div>

<p id="result"></p>

CSS

#result {
    font-size: 2em;
}

JavaScript

var p = document.getElementById("price"),
    res = document.getElementById("result");

p.addEventListener("input", function() {
    res.innerHTML = "$" + p.value;
}, false);