title: How to select element relative to 'this' in javascript
body: <p>I have the following:</p>
  
  <pre><code>&lt;div class="tab-pane" id="message"&gt;
        &lt;textarea rows="4" cols="50" id="send_message" placeholder="Enter text ..."&gt;  &lt;/textarea&gt;
        &lt;a href="#message" class="btn btn-large btn-info"  data-toggle="tab"&gt;OK&lt;/a&gt;
        &lt;a href="#message" class="btn btn-large btn-info"  data-toggle="tab"&gt;Cancel&lt;/a&gt;
  </code></pre>
  
  <p>I want to bind the click method to the 'div' element , and when one of the child 'a' elements is clicked do separate things. I am trying to distinguish between them using the button text, but the following is not working:</p>
  
  <pre><code>$(function(){
  
  $('#message').click(function(){
  
  if($(this + "&gt;a").is(":contains(OK)")) {
  
          console.log("OK!!");
  </code></pre>
  
  <p>How can I fix this?</p>