jQuery - Search on text entry - delay until full term entered <p>I have the following code, which detects any text entered into the <code>#search-box</code> field and then immediately runs the search (if greater than 2 characters):</p> <pre><code>$('#search-box').on('input', function() { var term = $(this).val(); if (term.length &gt; 2) { //execute search and display results } }); </code></pre> <p>This doesn't look pretty though, as if you were to type <code>dollar</code> for example, after 'doll' a load of dolls will appear, which will then be replaced with dollars once <code>dolla</code> is entered. This can happen in a split second.</p> <p>What I'd like to do is determine whether the user has finished the search term. Is it possible to wait for a second or 2 before doing the search? And if in that waiting period the user enters another letter, it resets the clock?</p>