Last active
December 11, 2015 06:19
-
-
Save nathanleclaire/4558564 to your computer and use it in GitHub Desktop.
I figured out the answer to this question :)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>Interval Shenanigans</title> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
<style> | |
input { | |
margin: 20px; | |
} | |
</style> | |
</head> | |
<body> | |
<input type="text" id="myBox" /> | |
<script> | |
function popUp() { | |
if (this.timeoutId) window.clearInterval(this.timeoutId); | |
this.timeoutId = window.setTimeout(function () { | |
$('body').append('timeout timeout timeout'); | |
}, 2000); | |
} | |
$('#myBox').keypress(popUp); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment