jQuery Selector
<p>I want to achieve going to the parent element then to the prev element get the atrribute id of the element which has class: classname.</p>

<pre><code>&lt;div&gt;

&lt;span&gt;&lt;span id="190" class="classname"&gt;blabla&lt;/span&gt;&lt;/span&gt;

&lt;span&gt;&lt;a href="#" class="button"&gt;blabla&lt;/a&gt;&lt;/span&gt;

&lt;/div&gt;
</code></pre>

<p>Pseudo code:</p>

<pre><code>$('.button').click(function(){
 console.log($(this).parent().prev().$(".classname").attr("id"));
});
</code></pre>

<p>Do I have to use a find here or is there another way?</p>
