문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top