title: How to get user selected option from dropdown in a table row with jQuery
body: <p>I'm trying to get the value of a dropdown in a table row that has been dynamically created from the server from data pulled from the database.
  Example:</p>
  
  <pre><code>&lt;table&gt;
    &lt;tr&gt;
      &lt;td&gt;
        &lt;select onChange="setPaymentAmt()"&gt;
          &lt;option value="1"&gt;Option1&lt;/option&gt;
          &lt;option value="2"&gt;option2&lt;/option&gt;
        &lt;/select&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
     &lt;td&gt;
      &lt;select onChange="setPaymentAmt()"&gt;
        &lt;option  value="3"&gt;Option1&lt;/option&gt;
        &lt;option  value="4"&gt;option2&lt;/option&gt;
      &lt;/select&gt;
    &lt;/td&gt;
   &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>If I want to grab the value from a user selected option for a specific row using jquery how do I get it?</p>
  
  <p>Here is what I have tried:</p>
  
  <pre><code>function setPaymentAmt() {  
      var data = $(this).closest('select option:selected').val();
      alert(data);
  }
  </code></pre>
  
  <p>when I alert that it shows undefined </p>