jQuery val() only returns value when input box set by user
<p>If I manually enter text into an input element, I can call <code>$("#myinput").val()</code> and get a value.</p>

<p>If I set it first like <code>$("#myinput").val("foo")</code> and then call <code>$("#myinput").val()</code>, it returns nothing.</p>
