I have an input range, the step is not fully divisible by the possible values, I tried setting step value conditionally but didn't work, is there any way this slider can be completed ?
any hack?
My requirements are to take minimum, maximum and step from user.
const orignalStep = 35;
function onChange() {
document.getElementById("my-slider").step = orignalStep;
const val = document.getElementById('my-slider').value;
document.getElementById('label').innerText = val;
/* const isAtSecondLastStep = val + 35 >= 100;
if (isAtSecondLastStep) {
const newStep = 100 - val;
document.getElementById("my-slider").step = newStep;
} */
}
<input min="0" max="100" step="35" value=0 id='my-slider' type="range" oninput='onChange()'/>
<span id='label'>0</span>