applying same function to many elements (in order)
<p>any better way to do that (assuming I have 10 <code>a</code> elements, for instance)?</p>

<pre><code>$('#id &gt; a:nth-child(1)').click(function() { changeP(1); return false; });
$('#id &gt; a:nth-child(2)').click(function() { changeP(2); return false; });
$('#id &gt; a:nth-child(3)').click(function() { changeP(3); return false; });
</code></pre>

<p>I know 2 possibilities, but I don't particularly like them:</p>

<ol>
<li>using <code>.bind()</code> with parameter instead of <code>.click()</code></li>
<li>using <code>.map(return $(this))</code> and then iterating over the array with an index var</li>
</ol>
