There is a textbox which is associated with an onkeyup event listener (a JavaScript function, say that alerts something). For an example-
<input type='text' name='text1' onkeyup='exec(this.value);'/>
<script>
exec = function(textdata) { alert(textdata); }
</script>
In this case the alert message will come each time the user hits something on the keyboard.
Is there any way of even handling, where in the event handler will proceed only after a few seconds of inactivity. that is, in this case the alert message will come only if the user has done typing a long text, and is thinking if he wants to add something more or not. For example, he types in his first name and waits for 2 second and after that the alert message appears, and alert message does not appears while he types in each letter of his first name.