jquery - using .closest()
<p>I'm stucking with jQuery where I need to use closest to get the .text() of the wanted element.</p>

<p>Here is the HTML:</p>

<pre><code>&lt;div class="endorse-set"&gt;
&lt;div class="endorse"&gt;
&lt;span class="keyword" id="keyword-1"&gt;web developer&lt;/span&gt;
&lt;textarea class="comment" id="comment-1"&gt;&lt;/textarea&gt;
&lt;input type="button" class="endorse-button" id="endorse-button-1" value="Endorse"&gt;
&lt;/div&gt;​​​​​​​​​​​​​​​​​​​​​​
&lt;div class="endorse"&gt;
&lt;span class="keyword" id="keyword-2"&gt;web designer&lt;/span&gt;
&lt;textarea class="comment" id="comment-2"&gt;&lt;/textarea&gt;
&lt;input type="button" class="endorse-button" id="endorse-button-2" value="Endorse"&gt;
&lt;/div&gt;​​​​​​​​​​​​​​​​​​​​​​
&lt;div class="endorse"&gt;
&lt;span class="keyword" id="keyword-3"&gt;Entrepreneur&lt;/span&gt;
&lt;textarea class="comment" id="comment-3"&gt;&lt;/textarea&gt;
&lt;input type="button" class="endorse-button" id="endorse-button-3" value="Endorse"&gt;
&lt;/div&gt;​​​​​​​​​​​​​​​​​​​​​​
&lt;/div&gt;
</code></pre>

<p>I need to get the <code>.text()</code> i.e. <strong>web designer or web developer or entrepreneur</strong> and the <code>.comment</code> value, when the user clicks <code>.endorse-button</code></p>

<p>I tried like this and failed:</p>

<pre><code>$(".endorse-button").click(function(){        
        var keyword = $(this).closest('span.keyword').text();
        var comment = $(this).closest('textarea.comment').val();
        alert(keyword);
        alert(comment);
});
</code></pre>

<p>I'm getting nothing. Could you help me?</p>

<p>P.S. I'm new to jQuery!</p>

<p>Thanks!</p>
