Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

274
Vistas
How to complete input type range, when step value is not fully divisible?

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>

about 4 years ago · Santiago Gelvez
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda