For a good cross-browser behavior, and understandable code, best is to use the onchange attribute in combination of a form:
function showVal(){
valBox.innerHTML = inVal.value;
}
_x000D_
<form onchange="showVal()">
<input type="range" min="5" max="10" step="1" id="inVal">
</form>
<span id="valBox"></span>
_x000D_
The same using oninput, the value is changed directly.
function showVal(){
valBox.innerHTML = inVal.value;
}
_x000D_
<form oninput="showVal()">
<input type="range" min="5" max="10" step="1" id="inVal">
</form>
<span id="valBox"></span>
_x000D_