title: Find closest input and set value
body: <p>On select value change I want find closest input by class and change value.</p>
  
  <p><strong>JS</strong></p>
  
  <pre><code>&lt;script type="text/javascript" charset="utf-8"&gt;
      $(document).ready(function(){
  
          $('#doc_service').on('change', function (){
  
              $.getJSON('\/services\/search-service', {id: $(this).val()}, function(data){
  
                  $(this).closest('.price').val(data);
  
                 //$('.price').val(data);
  
  
              });
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>My code <code>$(this).closest('.price').val(data);</code> not changing value, I try <code>$('.price').val(data);</code> it's work, but I have many input and want change value only one closest. Structure <code>html</code> is <code>table</code></p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;tr&gt;
      &lt;td&gt;
          &lt;select id="doc_service"&gt;
              &lt;option value="volvo"&gt;Volvo&lt;/option&gt;
              &lt;option value="saab"&gt;Saab&lt;/option&gt;
              &lt;option value="mercedes"&gt;Mercedes&lt;/option&gt;
              &lt;option value="audi"&gt;Audi&lt;/option&gt;
          &lt;/select&gt;
      &lt;/td&gt;
      &lt;td&gt;
          &lt;input type="text" class="price"&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;
          &lt;select id="doc_service"&gt;
              &lt;option value="volvo"&gt;Volvo&lt;/option&gt;
              &lt;option value="saab"&gt;Saab&lt;/option&gt;
              &lt;option value="mercedes"&gt;Mercedes&lt;/option&gt;
              &lt;option value="audi"&gt;Audi&lt;/option&gt;
          &lt;/select&gt;
      &lt;/td&gt;
      &lt;td&gt;
          &lt;input type="text" class="price"&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>