title: Javascript change event on input element fires on only losing focus
body: <p>I have an input element and I want to keep checking the length of the contents and whenever the length becomes equal to a particular size, I want to enable the submit button, but I am facing a problem with the onchange event of Javascript as the event fires only when the input element goes out of scope and not when the contents change.</p>
  
  <pre><code>&lt;input type="text" id="name" onchange="checkLength(this.value)" /&gt;
  </code></pre>
  
  <p>----onchange does not fire on changing contents of name, but only fires when name goes out of focus.</p>
  
  <p>Is there something I can do to make this event work on content change? or some other event I can use for this?
  I found a workaround by using the onkeyup function, but that does not fire when we select some content from the auto completer of the browser.</p>
  
  <p>I want something which can work when the content of the field change whether by keyboard or by mouse... any ideas?</p>