Guest User

Untitled

a guest
Feb 12th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. <input type='text' name='text1' onkeyup='exec(this.value);'/>
  2. <script>
  3. exec = function(textdata) { alert(textdata); }
  4. </script>
  5.  
  6. <input type='text' name='text1' onkeyup='exec(this.value);'/>
  7. <script>
  8.  
  9. var timer; //This needs to be a global variable
  10.  
  11. exec = function(textData){
  12.  
  13. clearTimeout(timer);
  14.  
  15. timer = setTimeout(function(){ alert(textData) }, 2000);
  16. }
  17. </script>
Add Comment
Please, Sign In to add comment