title: How to implement a generic click event for anchors
body: <p>I have a PHP script that throws out a bunch of buttons (Format in case it is needed):</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;a class="ClassInfo" id="id"&gt;Name&lt;/a&gt;
  </code></pre>
  
  <p>The file is retrieved dynamically and there can be as many buttons as possible, maybe none, and maybe a million (unlikely though).</p>
  
  <p>I need to use JavaScript for this and can't just redirect the user to another website (mostly because the operation is repeated heavily and gets EXTREMELY tedious.).</p>
  
  <p>Is it possible for me to use some combination of JavaScript + jQuery to detect which button was pressed and do an operation appropriately?</p>
  
  <p>Example of what I am hoping for is this:</p>
  
  <ul>
  <li>User clicks one of the buttons (which has its unique id number).</li>
  <li>JavaScript detects which button was clicked (I can't just use fixed code as the number of buttons and the ids can change whenever they feel like it)</li>
  <li>JavaScript send out an Ajax request and does some fancy operations (I have this part covered)</li>
  </ul>
  
  <p>Now is it possible for me to detect which button was clicked?</p>