I have a block of debug code MyPartialContent.ascx: (returned from an jquery ajax call and inserted into DOM with $(“#container”).val(html); where html is the code block below
<input type"text" id="mydebugtextbox" value="world"/> -- shows a text box on web page with "world"
$("#mydebugtextbox").val("hello");
-- Should set value to "hello";
alert($("#mydebugtextbox").val());
-- should alert "hello" and it does but
-- the textbox on the page still shows "world"
This only happens when the page is initially loaded. If I hit f5 or refresh the page then everything works as expected.
I am lost.
Are you sure there’s only 1 input box with that ID in your whole DOM page?
if you have 2 input boxes, only the 1st one is going to be updated
See this sample,
http://jsfiddle.net/fedmich/hMqSq/
prev answer…
Supposing there are no spelling errors and you are putting your code on page load
Are you sure you dont have a plugin that autocomplete your input box?
What browser are you using?