title: How can I get the selected option of the closest element of my clicked box?
body: <p>I want to alert the selected <code>vat</code> option of the container where I clicked the box. But I get an undefined result:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).on('click', '.box', function(event) {
    var result = $(this).closest('.container').find('.vat').find("option:selected").val();
    alert(result);
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;tr class='container'&gt;
    &lt;td&gt;
      &lt;div class="box"&gt;box1&lt;/div&gt;
    &lt;/td&gt;
    &lt;td&gt;
      &lt;select class='vat'&gt;
        &lt;option value='0'&gt;0 %&lt;/option&gt;
        &lt;option selected value='7'&gt;7 %&lt;/option&gt;
        &lt;option value='19'&gt;19 %&lt;/option&gt;
      &lt;/select&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr class='container'&gt;
    &lt;td&gt;
      &lt;div class="box"&gt;box2&lt;/div&gt;
    &lt;/td&gt;
    &lt;td&gt;
      &lt;select class='vat'&gt;
        &lt;option value='0'&gt;0 %&lt;/option&gt;
        &lt;option value='7'&gt;7 %&lt;/option&gt;
        &lt;option selected value='19'&gt;19 %&lt;/option&gt;
      &lt;/select&gt;
    &lt;/td&gt;
  &lt;/tr&gt;</code></pre>
  </div>
  </div>
  </p>