jQuery scroll to top not working

Hi on this page http://bit.ly/d67oe4 I would like the ‘Top’ button just above the footer to scroll the page back to the top using jquery. I am using the script below in the <head> of the page but the effect isn’t working. Any idea why?

    <!-- Back to Top -->
    <script type="text/javascript">
    jQuery('a.backtotop').click(function(){
        alert('hello');
        jQuery('html, body').animate({scrollTop:0}, 'fast');
        return false;
    });
      </script>

worked thanks!

You need to put it in a $(document).ready – in the head, your selector doesn’t actually exist yet, so your click event is never being called.

jQuery(document).ready(function() {
        jQuery('a.backtotop').click(function(){
        alert('hello');
        jQuery('html, body').animate({scrollTop:0}, 'fast');
        return false;
    });
});