Delay Keyup
Sets an event handler when a keyup event fires after a specified timeout.
Install
npm install delay-keyup
Example
//There are several ways to use this plugin: //First, HTMLElement document.querySelector("input").delayKeyup(function(){ this.value = this.value.toUpperCase(); }); //Second, NodeList document.querySelectorAll("input").delayKeyup(function(){ this.value = this.value.toUpperCase(); }); //Third, jQuery $("input").daleyKeyup(function(){ $(this).val( $(this).val().toUpperCase() ); }); //Or, just call the function delayKeyup("input", function(){ this.value = this.value.toUpperCase(); });
Import in WebPack
;//Or; //Recommanded
Or in AMD
;
Sets a specified timeout
Default, the event handler will be triggered after 1500 milliseconds, but you can pass the second or third argument to this function a number to specified a custom timeout.
; //The second argumentdocument; //The third argument;