title: jquery - passing parameters to functions
body: <p>This seems like a simple question, but I can't find a simple answer.  So I'll start by giving a simple example.</p>
  
  <pre><code>&lt;a href="#" onclick="showmsg('bark')"&gt;dog&lt;/a&gt;
  &lt;a href="#" onclick="showmsg('meow')"&gt;cat&lt;/a&gt;
  </code></pre>
  
  <p>And here's a javascript function...</p>
  
  <pre><code>function showmsg(msg) {
    alert(msg);
  }
  </code></pre>
  
  <p>In the above example, additional content (lines of html) may be added without breaking the behavior (the javascript).  Each line of html passes its own parameter to the javascript to tell it what message it should display.</p>
  
  <p>If the html is changed to...</p>
  
  <pre><code>&lt;a href="#" class="showmsg"&gt;dog&lt;/a&gt;
  &lt;a href="#" class="showmsg"&gt;cat&lt;/a&gt;
  </code></pre>
  
  <p>Then how do I write a jquery function that knows which line of html was clicked?  In other words...</p>
  
  <p>How do I pass a parameter to a jquery function?</p>