Javascript events
<p>I am completely confused here. So I am looking for a solution for the following problem:</p>

<p>I want to trigger some function(for now an alert box) using jQuery on an input field. Conditions are:</p>

<ul>
<li>Input field always maintains the focus.</li>
<li>Input is fed from a USB device, which acts just like a keyboard input. So for 10 characters, there will be 10 keydown and keyup events.</li>
<li>Once input is filled with 10 characters, respective alert box should pop out.</li>
</ul>

<p>Now the problem I am facing, how do I find out that input fed in is not equal to 10 characters, so throw an error alert box.(lets say just 5 chars came in input, how do I figure out the final count is 5, because there will be 5 keyup events)</p>
