Using JQuery's .prev( ) to get the contents of a <p> after clicking a link
<p>I want to grab the contents of a     &lt; p > right before a link:</p>

<pre><code>&lt;p class="copiedText"&gt;aaa&lt;/p&gt;
&lt;a class="copy-btn" href="#"&gt;a copy button&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;

&lt;p class="copiedText"&gt;ccc&lt;/p&gt;
&lt;a class="copy-btn" href="#"&gt;a copy button&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
</code></pre>

<p>and have it copied to the clipboard using <a href="http://www.steamdev.com/zclip/" rel="nofollow">zClip</a>.</p>

<p>I have it working for individual links using this JQuery snippet:</p>

<pre><code>$(document).ready(function(){
    $('a.copy-btn').zclip({     
        path:'js/ZeroClipboard.swf',
        copy:$('p.copiedText').text(),
    });
});
</code></pre>

<p>But when there are multiple buttons/links all the <code>&lt;p&gt;</code>'s contents get copied at once. I'm trying to implement the <a href="http://api.jquery.com/prev/" rel="nofollow">.prev()</a> operator as such:</p>

<pre><code>copy:$('p').prev('.copiedText').text()
</code></pre>

<p>But to no avail. I've implementing prev() in a lot of different ways but with no results.</p>

<p>Am I misunderstanding how prev works? Or am I just botching the implementation?</p>

<p>(I would link to a jsfiddle of it but the click-to-copy functionality isn't working on there)</p>

<p>[edit: ID's to class's, woops']</p>
