title: JQuery Detect change input where the change was made by JS
body: <p>I want to detect a change in the input value where the change was made by JS.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;input type="text" name="test_input"&gt;&lt;br&gt;&lt;br&gt;
  &lt;button name="change_input"&gt;Change usign JS &lt;/button&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>$(function() {
      $('body').on('change','input[name="test_input"]',function() {
          alert('Changed');
      });
      $('button[name="change_input"]').on('click',function() {
          $('input[name="test_input"]').val('New value');
      });
  })
  </code></pre>
  
  <p><a href="https://jsfiddle.net/7c54r7x9/" rel="nofollow noreferrer">https://jsfiddle.net/7c54r7x9/</a></p>
  
  <p>Thanks</p>