大家好我是stackoverflow的新手。问题是我无法从“p”标签中的“范围”滑块“提取”滑块输出。这是我的代码:
HTML:
<div id="slider" class="range-slider" data-slider data-options="display_selector: #sliderOutput3;">
<span class="range-slider-handle"></span>
<span class="range-slider-active-segment"></span>
</div>
<span id="sliderOutput3"></span>
<p id="qj"></p>
JavaScript的:
<script>
var element=document.getElementById('slider');
var val = element.getAttribute('data-slider');
document.getElementById("qj").innerHTML=parseInt(val);
</script>