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

234
Vistas
How can i get the text value from a HTML number input field and not the transformed number value?

I need the text value of an input type="number" field because I need to scale other elements depending on its size.

const numberInput = document.getElementById('numberInput');
const outputSpan = document.getElementById('output');

numberInput.addEventListener('input', (inputEvent) => {
 outputSpan.innerText = inputEvent.target.value;
});

Does not work for inputs like ["e", "-", "+", "+132", "123e123123"] I know that in the background the input is transformed into the corresponding number but i need the original string for my resizing/positioning.

For clearity a link to a Stackblitz example:

  • vanillaJs: https://stackblitz.com/edit/js-fcjh2f?file=index.js
  • angular: https://stackblitz.com/edit/angular-ivy-duc89z?file=src/app/app.component.ts

For any help i would be grateful.

[Edit] Updated the angular example, so now it should be clear what the problem is.

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