html
<input type="button" id="test" value="123213">
javascript
var timeout; var clearInterval = true; $(document).on('click', '#test', function(e){ e.preventDefault(); if (clearInterval) { clearInterval = false; console.log('test phrase'); timeout = setTimeout(function() { clearTimeout(timeout); clearInterval = true; }, 2000); return false; } });
Upd:
As they say in the commentary: by the way, it makes no sense to do clearTimeout inside the handler, this is not an interval, it will be cleaned itself, a one-time fact. It would make sense to clear - outside to interrupt the timer.
I left it just in case, but you can play around to see if you need it or not.