title: Passing variables to jquery function
body: <p>I'm trying to pass a changing variable to jquery function below but missing a piece.</p>
  
  <pre><code>  $(document).ready(function(){    
  
    var area = "NW";
  
    $("#NWbutton").click(function (){
     $('#mainmap &gt; img').attr('src', "some_web_"+area+"_address_forpics_time.gif");
    });
  
  
  });
  </code></pre>
  
  <p>For the "NWbutton" I need var area = "NW".  I have 20 or so buttons with corresponding variables.  How do I pass these for each button instead of writing out each variable?</p>