Javascript examples for DOM Event:onkeyup
Using "onkeyup" together with the "onkeydown" event:
<!DOCTYPE html> <html> <body> <input type="text" id="demo" onkeydown="keydownFunction()" onkeyup="keyupFunction()"> <script> function keydownFunction() {//www . j a va2 s .co m document.getElementById("demo").style.backgroundColor = "red"; } function keyupFunction() { document.getElementById("demo").style.backgroundColor = "green"; } </script> </body> </html>