I am just learning js and was able to do a few things, but I was then recomended by Raffles that I should be using unobtrusive js, so I started working on it but I got stuck on the IE attachEvent, can someone point me in the right direction?

here is my code

Code HTML4Strict:
<html>
<head>
</head>
<body>
name: <input id="test" name="test" type="text" size="50" maxlength="50"/>
<script type="text/javascript">
function format(event)
{
	var target = event.target;
    target.style.background = "#FFFF00";
}
var myvar=document.getElementById("test");
if (myvar.addEventListener)
{
myvar.addEventListener('change', format, false);
}
else if (myvar.attachEvent)
{
myvar.attachEvent('onblur', format);
}
</script>
</body>
</html>