Javascript examples for jQuery Method and Property:keyup
Attach a function to the keyup event:
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("input").keydown(function(){ $("input").css("background-color", "yellow"); });/*w ww . ja v a2 s. com*/ $("input").keyup(function(){ $("input").css("background-color", "pink"); }); }); </script> </head> <body> Enter your name: <input type="text"> <p>Enter your name in the input field above.</p> </body> </html>