<p>I have an HTML input box</p>

<pre><code>&lt;input type="text" id="foo" value="bar"&gt;
</code></pre>

<p>I've attached a handler for the '<em>keyup</em>' event, but if I retrieve the current value of the input box during the event handler, I get the value as it was, and not as it will be!</p>

<p>I've tried picking up '<em>keypress</em>' and '<em>change</em>' events, same problem. </p>

<p>I'm sure this is simple to solve, but at present I think the only solution is for me to use a short timeout to trigger some code a few milliseconds in the future!</p>

<p><em>Is there anyway to obtain the current value during those events?</em></p>

<p>EDIT: looks like I had a caching problem with my js file as I checked the same code later on and it worked just fine. I would delete the question, but not sure if that loses rep for the kind folk who posted ideas :)</p>

Can you post your code? I'm not finding any issue with this. Tested on Firefox 3.01/safari 3.1.2 with:
```
```
function showMe(e) {
// i am spammy!
  alert(e.value);
}
....
<input type="text" id="foo" value="bar" onkeyup="showMe(this)" />
```
```