Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

273
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!