title: Detecting Browser Autofill
body: <p>How do you tell if a browser has auto filled a text-box? Especially with username &amp; password boxes that autofill around page load.</p>
  
  <p>My first question is when does this occur in the page load sequence? Is it before or after document.ready?</p>
  
  <p>Secondly how can I use logic to find out if this occurred? Its not that i want to stop this from occurring, just hook into the event. Preferably something like this:</p>
  
  <pre><code>if (autoFilled == true) {
  
  } else {
  
  }
  </code></pre>
  
  <p>If possible I would love to see a jsfiddle showing your answer.</p>
  
  <p><strong>Possible duplicates</strong></p>
  
  <p><a href="https://stackoverflow.com/questions/3535738/dom-event-for-browser-password-autofill">DOM event for browser password autofill?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/4938242/browser-autofill-and-javascript-triggered-events">Browser Autofill and Javascript triggered events</a></p>
  
  <p>--Both these questions don't really explain what events are triggered, they just continuously recheck the text-box (not good for performance!).</p>