title: Detect when user is starting/stopping typing in jquery
body: <p>Once i was searching a solution for my issue and my issue was "I want to detect when user is typing and when he is stop typing so that i can update status."</p>
  
  <p>I have created a sample. May it will work for you.</p>
  
  <pre><code>var typingTimer;
  var doneTypingInterval = 10;
  var finaldoneTypingInterval = 500;
  
  var oldData = $("p.content").html();
  $('#tyingBox').keydown(function() {
    clearTimeout(typingTimer);
    if ($('#tyingBox').val) {
      typingTimer = setTimeout(function() {
        $("p.content").html('Typing...');
      }, doneTypingInterval);
    }
  });
  
  $('#tyingBox').keyup(function() {
    clearTimeout(typingTimer);
    typingTimer = setTimeout(function() {
      $("p.content").html(oldData);
    }, finaldoneTypingInterval);
  });
  
  
  
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt;
  
  
  
  &lt;textarea id="tyingBox" tabindex="1" placeholder="Enter Message"&gt;&lt;/textarea&gt;
  &lt;p class="content"&gt;Text will be replace here and after Stop typing it will get back&lt;/p&gt;
  </code></pre>
  
  <p><a href="http://jsfiddle.net/utbh575s/" rel="nofollow">View on Fiddle : http://jsfiddle.net/utbh575s/</a></p>