Skip to content

Instantly share code, notes, and snippets.

@rowan-m
Last active August 27, 2019 09:11
Show Gist options
  • Save rowan-m/cf8578abfaea7675bc4e53d965ec0d25 to your computer and use it in GitHub Desktop.
Save rowan-m/cf8578abfaea7675bc4e53d965ec0d25 to your computer and use it in GitHub Desktop.
<input-knob value="2.5"></input-knob>
<input type="range" name="angle" min="0" max="6.28" step="0.1" value="1" />
<script>
const knob = document.querySelector('input-knob');
const slider = document.querySelector('input[type=range]');
// Just take the value from the slider and set it straight on the knob
slider.addEventListener('input', () => { knob.value = slider.value; });
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment