title: jquery click handler that passes attribute of clicked object into function?
body: <p>I have a link like</p>
  
  <pre><code>&lt;a href="#" id="foo" class="bar_link"&gt;blah&lt;/a&gt;
  </code></pre>
  
  <p>I have many of these and the id value is an integer corresponding to a record in a database.</p>
  
  <p>I want to create a click handler to pass the id attribute value for a specific link into a function whenever that link is clicked. </p>
  
  <p>Here is what I have tried, but I am not having success.    </p>
  
  <pre><code>$(".bar_link").live('click', barDetailsInit($(this).attr('id')));
  </code></pre>
  
  <p>What do you think? Thx!</p>