jQuery TextChange plugin with timeout.


Example


        $('input#example-input').on('textchange.namespace1', 300, function(e) {
            $('span#example-result').html($(this).val());
        });
    
Result:

Available options


Option Type Default value Description
event.namespace String You can define a jQuery event namespace, see https://api.jquery.com/event.namespace/ for more information.
timeout Integer (milliseconds) 0 You can define a timeout which means the textchange event will be triggered if the user stops typing and timeout passed.
callback Function undefined This callback function will be triggered when a textchange occurs.

Available methods


Method Description
on('textchange.namespace', timeout, callback) You can subscribe to textchange event with a namespace. Note that the namespace is optional. Example:
        
        $('input#onoff-input').on('textchange.namespace1', function(e) {
            $('span#onoff-result').html($(this).val());
        });
    
off('textchange.namespace') You can unsubscribe from textchange event with a namespace. Note that the namespace is optional. Example:
        
        $('input#onoff-input').off('textchange.namespace1');
    
Status:Not subscribed
Result: