Question

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?

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top