var slider = document.getElementById("range1"); var output = document.getElementById("l_pwm"); output.innerHTML = slider.value; // Display the default slider value // Update the current slider value (each time you drag the slider handle) slider.oninput = function() { output.innerHTML = this.value; }