Referencing button clicks to retrieve appropriate values from array
<p>I'm building a list of links dynamically using an array, which will result in something like this:</p>

<pre><code>&lt;div&gt;
   &lt;p class="link"&gt;label&lt;/p&gt;
   &lt;p class="link"&gt;label&lt;/p&gt;
   &lt;p class="link"&gt;label&lt;/p&gt;
   &lt;p class="link"&gt;label&lt;/p&gt;
   &lt;p class="link"&gt;label&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
   &lt;p class="link"&gt;label&lt;/p&gt;
   &lt;p class="link"&gt;label&lt;/p&gt;
   &lt;p class="link"&gt;label&lt;/p&gt;
   &lt;p class="link"&gt;label&lt;/p&gt;
   &lt;p class="link"&gt;label&lt;/p&gt;
&lt;/div&gt;
</code></pre>

<p>Then I would have a click handler:</p>

<pre><code>$(".link").click(function(){
//do something
 myarray[?].stuff;
});
</code></pre>

<p>I want to retrieve something from an array, but I'm not sure what the best way is to reference the link. I could add the array key as an id in the p tag, however I'm wondering if there is a more elegant way of handling it.</p>
