范围滑块更改给出 [object Object] 错误

Range slider change giving [object Object] error

想要范围滑块的值显示在滑块旁边。在 roadtripsharing.com/map-it 页面上,它给出了一个 [object Object] 错误,但是当我将 html 和脚本剪切并粘贴到一个片段(下面)中时,它似乎根本不起作用,并抛出一个'Unexpected end of input error.'

我做错了什么,我该如何解决?

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="range" min="0" max="100" value="33" id="rtsfader" style="display:inline-block">&nbsp;<output for="rtsfader" id="rtsmileage">33</output>&nbsp; miles
<script type="text/javascript">
function rtsoutputUpdate(vol) {
 document.querySelector('#rtsmileage').value = vol;
  console.log(vol); 
}
</script>

其实你不需要jQuery / JS。只需用 <form> 元素包围 <input><output>

<form oninput="rtsmileage.value = rtsfader.value">
      <input type="range" min="0" max="100" value="33" id="rtsfader" style="display:inline-block">&nbsp;<output for="rtsfader" id="rtsmileage">33</output>&nbsp; miles
<form>