title: EventListener for focus change?
body: <p>Is there a way to add an event listener to an input where by the focus changes from <code>onfocus</code> to something like <code>off focus</code> </p>
  
  <p>Basically i have an event listener assigned to my input box using <code>key up</code>, this then calls my server to check if the username is taken already in the database.</p>
  
  <p>The problem is - this will call every time the user presses a letter, i would rather wait until they are no longer focussed in the input box to check the database, so i can reduce the amount of calls?</p>
  
  <p>What would the best option be for event listening to do this ? As it seems silly to check when user is still typing in the box.</p>
  
  <p>I currently have:</p>
  
  <pre><code>mydiv.addEventListener("keyup",name_exist_validation(),false);
  </code></pre>