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?

Was it helpful?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top