Getting the img alt attribute from within an anchor tag

Getting the img alt attribute from within an anchor tag

My brain hurts...
I have tried for hours to work this out, but with no success.

  1. <a href="IMG_0001.jpg" rel="album" title="IMG_0001"><img src="IMG_0001.jpg" alt="IMG_0001" /></a>
  1. <script type="text/javascript">
        jQuery.noConflict();
        jQuery(document).ready(function() {
            jQuery("a[rel='album']").lightbox({title: function(){
                    var img = jQuery(this).attr('title');
                    return '<a href=download.php?file=' +img+ '.jpg>download ' +img+ '</a>';
            }});
        });
    </script>









All I want to be able to do is use the alt attribute in the image tag instead of the title attribute in the anchor tag.
I am sure this is simple but I have no idea how to do it.

Any help would be appreciated...