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

150
Views
Cómo cambiar el texto junto a un formulario deslizante usando JavaScript

Tengo el siguiente código en html y js

 function slide(){ let v= document.getElementById("slide_inner"); document.getElementById("slider").textContent=v.value; }
 <form id="slider"> <label for="slide_inner">0</label><input id="slide_inner" onchange="slide()" type="range" min="0" max="26" value="0" class="slider"> </form>

Sin embargo, cuando intento mover el control deslizante, el control deslizante también desaparece y solo queda el valor. Solo quiero que el 0 se actualice al nuevo valor del control deslizante. ¿Hay alguna manera de evitar esto?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puede usar querySelectorAll para establecer el texto:

 function slide() { let v = document.getElementById("slide_inner"); document.getElementById("slider").querySelectorAll("label")[0].innerHTML = v.value; }
 <form id="slider"> <label for="slide_inner">0</label><input id="slide_inner" onchange="slide()" type="range" min="0" max="26" value="0" class="slider"> </form>

about 4 years ago · Juan Pablo Isaza Report
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!