[jQuery] My simple fading div test isn't working, firebug says anchor tag is null?

[jQuery] My simple fading div test isn't working, firebug says anchor tag is null?


I'm doing some simple tests and I can't get this to work on a
wordpress site. Basically I'm trying to fadeOut a div with id of "box"
when a link is clicked. I mentioned Wordpress because the head code is
loaded dynamically into the page template, as well as the body
content. I wasn't sure i this made a difference in diagnosing the
problem. When I load the page, Firebug keeps giving an error...
$('a') is null
Here is my stripped html code...Thanks for any help!
<head>
<script src="http://www.moxiedisplays.com/js/jquery-1.3.2.min.js"
type="text/javascript"></script>
<style type="text/css">
#box {background-color: red; width: 300px; height: 300px;}
</style>
<script type="text/javascript">
$(function() {
$('a').click(function() {
$('#box').fadeOut();
});
});
</script>
</head>
<body>
<div id="box">
</div>
<a href="#">Fade Out</a>
</body>