Issue with on change event

Issue with on change event

Hi

I'm populating a text field dynamically with Postcode Anywhere API. The alert below works only when I manually edit the text field # input_42 and not when the field gets dynamically populated. Can anyone tell me what the issue is? Thanks

  1. jQuery('#input_42').on('change', function() { 
  2. alert(jQuery('#input_42').val());
  3.  });