on-internet
← Community

how to align a slider (input type range) with the text to its right for its value?

Stack Overflow ·

What would be the simplest way to align a slider with the value of the slider which is on its right? Without using external library. Just using HTML5? Do I need to use CSS for this? How? updateTextInput('0'); function updateTextInput(val) { document.getElementById('amount').value = val; //update current slider value // do other action here } <input type="range" id="rangeInput" name="rangeInput" min="0" max="100" value="0" step="1" oninput="updateTextInput(this.value);"> <output name="amount" id="amount" for="rangeInput">0</output> When running the above, the output (on Chrome on windows looks

Comments

Sign in or sign up to comment and upvote.

No comments yet.