input change event triggered on blur

html, javascript, jquery

Solution

$(function(){
  $('#onchange').on('change',function(){
    alert('changed')
  });
  
   $('#onEveryLetter').on('input',function(){
    alert('onEveryLetter')
  });
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
onchange: <input type="text" id="onchange" name="Jenish" />
<br/>
onEveryLetter: <input type="text" id="onEveryLetter" name="Jenish" />

Problem

when I change the value of a text input and then blur that input it triggers the `input change` event again. How can it register this blur as an input change? is there a way to prevent this? ``` $('input').on('input change',function(){ //do something }); ```

Original source

Related problems