how to select a tag before a div with a class
<p>I have this:</p>

<pre><code>&lt;a href="#"&gt;link1&lt;/a&gt;
&lt;a href="#"&gt;link2&lt;/a&gt;
&lt;div class="test"&gt;
&lt;p&gt;text&lt;/p&gt;
&lt;/div&gt;
</code></pre>

<p>I want to select the first a tag before div.test and add a class to it, so I tried this:</p>

<pre><code>$('a').before('.test').addClass('test');
</code></pre>

<p>this works, but it also actually prints ".test" on the page.</p>

<p>Help?</p>
