jQuery keyup Event
RUN
<!DOCTYPE html> <html> <head> <title>Keyup Event</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script src="https://code.jquery.com/jquery-2.0.0.js"></script> <script> $(document).ready(function(){ var time = 0; $('#age').keyup(function(){ time++; $('#result').html("Keyup lần thứ " + time + ". Giá trị nhận được là " + $(this).val()); }); }); </script> </head> <body> <input type="text" id="age" value=""/> <div id="result"> </div> </body> </html>
PHÓNG TO