Javascript Onkeyup Event Example
Apr 07, 2021 . Admin
![](/upload/blog/javascript-onkeyup.png)
<!DOCTYPE html> <html> <head> <title>Javascript - How to check if onkeyup event?-MyWebtuts.com</title> </head> <body> <label>Enter your name:</label> <input type="text" value="hello" id="name" onkeyup="myFunction()"> <script> function myFunction() { var x = document.getElementById("name"); x.value = x.value.toUpperCase(); } </script> </body> </html>Output: 1
HELLOExample: 2 In this example i will use attribute for onclick event.
<!DOCTYPE html> <html> <head> <title>Javascript - How to check if onkeyup event?-MyWebtuts.com</title> </head> <body> <input type="text" id="demo" onkeyup="keyupFunction()"> <script> function keyupFunction() { document.getElementById("demo").style.backgroundColor = "blue"; } </script> </body> </html>Output: 2
after typing textbox has blue color
It will help you....