title: jQuery getting the closest div with a class
body: <p>Hii i want to show the number chars to the closest div with the class <code>showchars</code>.</p>
  
  <p>I tried to do this :</p>
  
  <pre><code>$('#maina').focus(function() {
  $(this).closest("div.showchars").find(".countchars").html("KKK");
      $("#error-1").html("");
      $(this).closest(".showchars").html("hmm");
  });
  </code></pre>
  
  <p>With this html:</p>
  
  <pre><code>    &lt;tr&gt;
      &lt;td&gt;
      Main Alliase/Current Alliase:
      &lt;/td&gt;
      &lt;td&gt;&lt;input type="text" id="maina" class="countchars"/&gt;&lt;br /&gt;
      &lt;div class="showchars"&gt;o&lt;/div&gt;
      &lt;/td&gt;
  &lt;td&gt;&lt;span id="handle-1" class="selector"&gt;?&lt;/span&gt;&lt;/td&gt;
      &lt;td&gt;&lt;div id="error-1" class="errors"&gt;&lt;/div&gt;&lt;/td&gt;
      &lt;/tr&gt;
  </code></pre>
  
  <p>When i focus into the input boxes it does resets the content of the errors class.</p>
  
  <p>But doesnt changes text to : <code>hmm</code> in the div.</p>
  
  <p>Where have been i going wrong or what is the better way to get the closest div and then implement the api : <code>.html("hmm")</code> ?</p>
  
  <p>Thanks</p>