大家好,我是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>