Run this in IE 7,8 or 9.
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title>IE input value</title>
</head>
<body>
<form action="">
<input id="test" type="text" name="username">
</form>
<script>
var input = document.getElementById("test");
alert(input.value);
setTimeout(function() {
alert(input.value);
}, 2000);
</script>
</body>
</html>
If you enter a value manually, then hit "refresh", the first alert is empty, the second alerts whatever you typed, so it seems IE takes a little longer to "auto-populate" the field again.
Question: is anyone else experiencing this and if so: is there a better way than using setTimeout here?
BTW: Firefox alerts what you typed two times (as I would expect).