Pregunta

I have an input and I set its value with jQuery

$('#' + inputId).val(function() {
    alert("SETTING VAL TO "+ myValue);
    return myValue;
});

Low and behold this sets the value, as verified in the console. However the displayed value in the input text area does not change. How do I do that?

¿Fue útil?

Solución

It turned out I had two elements with the same id. Weird thing is the chrome element inspector showed the correct value attribute for the input, but the text did not change, presumably for this reason.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top