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

154
Vistas
How to change the text next to a slider form using JavaScript

I have the following code in html and 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>
        

However, when I try and move the slider, the slider also disappears and the only the value remains. I only want the 0 to be updated to the new slider value. Is there a way I can avoid this?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can use querySelectorAll to set the text:

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 Denunciar
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