There is a lot of examples about keypress, keyup,... in jQuery. These examples are about typing in text field. When user type a message or something in text field we can display something like User is typing but we can't display a message about situation when user don't type. Here is an example from http://api.jquery.com/keypress/:
$("#target").keypress(function() {
$("#other).html("User is typing");
});
<form>
<fieldset>
<input id="target" type="text" value="" />
</fieldset>
</form>
<div id="other">
Trigger the handler
</div>
How can I change this code and display message (user is not typing) when he don't type? Something like else option....
EDIT: Here is my idea. It is similar with yours idea (code). Thanks for helping.
$(document).ready(function(){
$("#target").keyup(function(){
setTimeout(function(){
$("#other").html("User is not typing");
}, 2000);
});
$("#target").keydown(function(){
$("#other").html("User is typing");
});
});