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

170
Vistas
Changing input type="number" - value changes, but not the front-end number

I'm working on an option tokenizer for Magento Bundle Product.

I have a input type=number that I want to change with jQuery / Javascript.

<input id="bundle-option-7-qty-input" class="input-text" type="number" value="1">

To change the value I do this:

$("#bundle-option-7-qty-input").attr('value', 99);

The value is changing within the HTML element, but the look of the element does not change the number.

<input id="bundle-option-7-qty-input" class="input-text" type="number" value="99">

Wrong front-end value

Should be this:

Correct front-end value

It seems like the value attribute is somehow disconnected from the front-end view of the element itself.

I have looked at MDN article on this element and could not find any attribute that would be responsible for the front-end change: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number

Any ideas how I can change this element's front-end look value?

UPDATE:

I have tried .val() it has the same effect - this is some kind of issue with input type="number"

If you create HTML file with:

And within the Chrome console change the value to 99

The front-end will still show 1:

input type ="number" after HTML element change in Chrome console

UPDATE: it looks like Magento 2 might be changing value property after / before I make the change with jQuery.

Is there a way to detect / block this change?

UPDATE: for now just putting setting timeout and then changing the input seems to work.

I'll see if I can detect the value change.

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