基础5范围 - 滑块值

时间:2015-07-08 09:39:58

标签: javascript zurb-foundation zurb-foundation-5 rangeslider

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

0 个答案:

没有答案