selector within local scope

selector within local scope

Not sure how this can be done in jquery, need help... Let me explain the question using an example:
  1. <html>
  2. <head>
  3.         <script type="text/javascript" src="jquery-1.4.2.js"></script>
  4.         <script type="text/javascript">
  5.                 $(document).ready(function() {
  6.                         $("#span1").click(function() {
  7.                                 alert($("img:eq(1)").attr("alt"));
  8.                         });
  9.                 });
  10.         </script>
  11. </head>
  12. <body>
  13.         <div id="div1">
  14.                 <span id="span1">ABC</span>
  15.                 <img src="1.jpg" width="100" height="100" alt="pic1" id="img1">
  16.         </div>
  17.         <img src="2.jpg" width="100" height="100" alt="pic2">
  18. </body>
  19. </html>
If you run it, the alert message is "pic2", so jquery sees the entire document, but is there a way to easily restrict it to the sub-tree under the current node (in this case the sub-tree under the span node, since that's what was clicked)? Yes, I can do something like
  1.                                 alert($("#div1 img:eq(1)").attr("alt")); //undefined as expected

But I am looking for a solution that's more dynamic, so I don't need to hard code #div1.