I'm reading sitepoints simply javascript book and this piece of code from page 92-93 wont work..

Code:
<html>
<head>
<script type="text/javascript">


var target = document.getElementById("berenger");
alert(target.nodeName);

</script>


</head>
<body>


<h1>
Sniper (1993)
</h1>
<p>
In this cinema masterpiece,
<a id="berenger" href="/name/nm0000297/">Tom Berenger</a> plays
a US soldier working in the Panamanian jungle.
</p>
</body>
</html>