Onkeyup isn't working in IE8

Onkeyup isn't working in IE8

My code:
<!DOCTYPE html>
<html>
<head>
<script>
window.onkeyup= function (event ){
alert('123')
};

function myFunction()
{
var x=document.getElementById("fname");
x.value=x.value.toUpperCase();
}
</script>
</head>
<body>

<p>A function is triggered when the user releases a key in the input field. The function transforms the character to upper case.</p>
Enter your name: <input type="text" id="fname" onkeyup="myFunction()">

</body>
</html>