So referencing this: How to delay the .keyup() handler until the user stops typing?
I came up with the following code. But it does nothing... Any suggestions?
I am trying to get the setTimeout to cancel if the user types something further, so that multiple alerts don't happen, only one when the user finally 'stops' (hopefully).
Thanks!!
var t = 0;
$('input').keyup(function(){
clearTimeout(t);
t = setTimeout(alert($('input').val()),1000);
}