Snippets › Simple Done Typing jQuery function

This simple jQuery function can be used to trigger a callback everytime user stops typing. Just apply this to any text input fields such as textarea to see it in action.

(function($) {
$.fn.donetyping = function(callback){
    var _this = $(this);
    var x_timer;    
    _this.keyup(function (){
        x_timer = setTimeout(clear_timer, 1000);

    function clear_timer(){

Usage :

        //your code goes here.