Javascript examples for jQuery:Form Event
Check input field value in keydown event handler
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.0.js"></script> <script type="text/javascript"> $(function(){// w w w . ja va2 s. c om $('.text').on('keydown', function(e) { if ($(this).val().length >= 3) { console.log('d'); } }); }); </script> </head> <body> <textarea class="text"></textarea> </body> </html>