<div class="range">
<input type="range" min="0" max="100" step="1" value="20">
<input type="text" value="20">
</div>
const range = document.querySelector('.range [type="range"]');
const text = document.querySelector('.range [type="text"]');
range.oninput = () => text.value = range.value;
text.oninput = () => range.value = text.value;
// или
document.querySelector('.range').addEventListener('input', e => {
e.currentTarget.querySelectorAll('input').forEach(n => n.value = e.target.value);
});
// или
const inputs = document.querySelectorAll('.range input');
const onInput = e => inputs.forEach(n => n.value = e.target.value);
inputs.forEach(n => n.addEventListener('input', onInput));