<span id="valBox"></span> <input type="range" min="5" max="10" step="1" onchange="showVal(this.value)"> <script> const showVal = (newVal) => { document.getElementById("valBox").innerHTML=newVal; }; </script>