I'm getting this really stupid error that makes no sense because everything looks right. I know it's late and I may be missing something, but does anyone see something that's causing this error?

test has no properties

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Promo</title>
<script type="text/javascript">
var test = document.getElementById('test');
var link = test.getAttribute('href');

link.onclick = window.close();
</script>
</head>

<body>
<a href="http://www.cnn.com" id="test"><img src="/i/promo.jpg" width="400" height="100" alt="" /></a>
</body>
</html>