title: JQuery click listener for class
body: <p>I have a class of images in HTML, with IDs <code>img1</code>,<code>img2</code>,...,<code>img9</code>. I want to make links (HTML <code>a</code> tag) with IDs <code>link_img1</code>, <code>link_img2</code>, ..., <code>link_img9</code> so that whenever I click on a link, the corresponding image appears.</p>
  
  <p>I'm thinking about assigning all the links to the same class, then add a JQuery click listener for that class, and inside the listener, look for the ID of that link, and shows the corresponding image. How do I add a JQuery listener for a <em>class</em>, and how do I get the ID from the element?</p>