title: Textarea: can it detect the loss of focus
body: <p>In HTML or Javascript is it possible to detect when a textarea looses focus? </p>
  
  <p>I have a text area &amp; on loosing focus I want to read the data in a textarea &amp; check if its valid.</p>
  
  <p>Maybe...</p>
  
  <pre><code>&lt;textarea onloosefocus="myFunct();"&gt;
  &lt;/textarea&gt;
  
  // or
  var isTyping = false;
  
  function onKeyUp( event )
  {
     setTimeout( function()
     {
        isTyping = false;
     }, 100);
  
     setTimeout( function()
     {
        if (!isTyping)
           validateTextArea();
     }, 500);
  }
  
  function onKeyDown( event )
  {
     isTyping = true;
  }
  
  &lt;textarea onkeydown="onKeyDown(e);" onkeyup="onKeyUp(e);"&gt;
  &lt;/textarea&gt;
  </code></pre>