html make range bar show value

function updateTextInput(val) {
          document.getElementById('textInput').value=val; 
        }<input type="range" name="rangeInput" min="0" max="100" onchange="updateTextInput(this.value);">
<input type="text" id="textInput" value="">