给你个例子:
<input type="range" id="myRange">
<p>点击按钮来获得滑块控件的值。</p>
<button onclick="myFunction()">试一下</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myRange").value
document.getElementById("demo").innerHTML = x
}
</script>
http://www.w3school.com.cn/tiy/t.asp?f=jsref_range_get