Javascript DOM HTML Input Text handle key up event
<!DOCTYPE html> <html> <body> Enter your name: <input type="text" id="fname" onkeyup="myFunction()"> <p>My name is: <span id="demo"></span></p> <script> function myFunction() {/* w w w . ja v a 2 s .c om*/ var x = document.getElementById("fname").value; document.getElementById("demo").innerHTML = x; } </script> </body> </html>