Passing a parameter to jQuery function?
<p>This looks very simple but I have little experience with jQuery and I can't wrap my head around it.</p>

<p>Let's say I have a dynamically generated HTML table, and in each row of this table is a link:</p>

<pre><code>&lt;a id='edit'&gt;Edit User&lt;/a&gt;
</code></pre>

<p>Now, the link should call a function with each user's ID as a parameter. I could do that inline liek this:</p>

<pre><code>&lt;a id='edit' onClick='editUser(&lt;?php echo $row['id']; ?&gt;)'&gt;Edit User&lt;/a&gt;
</code></pre>

<p>But how do I do this in jQuery?</p>

<p>I can call the function like this:</p>

<pre><code>$('a#edit').click(function () {
      editUser()
      return false;
    });
</code></pre>

<p>But how do I pass the ID to this function? I know I could first stick it into a hidden field and then get it from there by element id, but surely there's a better way?</p>

<p>I realize all the links would have the same id this way, so should I dynamically create the link ids by appending the user id? But then how do I call the jQuery?</p>
