title: Change the value of dynamically created input fields using jQuery
body: <p>Please view the following jsfiddle;</p>
  
  <p><a href="https://jsfiddle.net/1kvwxmyb/3/" rel="nofollow">https://jsfiddle.net/1kvwxmyb/3/</a></p>
  
  <p>Basically, the code allows the user to add 'lines' to an invoice. When the user selects the 'VAT Rate' of a product, I need the 'VAT Amount' and 'Gross Amount' to be calculated using jQuery. Calculating these figures is basic maths but at present I can't even get the jQuery to set any type of value in 'VAT Amount' and 'Gross Amount' never mind the correct figure!</p>
  
  <p>Please help.</p>
  
  <p>jQuery</p>
  
  <pre><code>// calculate VAT amount and set gross amount
  
  $(".vat_rate").change(function () {
  
      alert("Handler for .change() called.");
  
      $(this).nextAll('input').first().val("123");
  
  });
  </code></pre>