As soon as I was looking for a solution to my problem, and my problem was "I want to determine when the user is printing and when he stops printing to update the status."
I created a sample. Let it work for you.
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); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <textarea id="tyingBox" tabindex="1" placeholder="Enter Message"></textarea> <p class="content">Text will be replace here and after Stop typing it will get back</p>
Script view: http://jsfiddle.net/utbh575s/
javascript jquery html typing
Ambuj khanna
source share