Finding parent of an element with jQuery
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/4977776/detecting-closest-or-parent-div">Detecting closest or parent div</a>  </p>
</blockquote>



<p>I need some help about finding elements with jquery. As topic hints, i need to find the container of given element. i already have a code like;</p>

<pre><code>$('.cancel_button').bind "click", (event) -&gt;
    element = $(this.parentElement)
    ...
    ...
</code></pre>

<p>But it seems very ugly to me. Cancel <code>button</code> is in a <code>section</code> element. I wonder if it is possible to do something like </p>

<pre><code>$(this).containerElement('section')
</code></pre>
