Javascript DOM HTML Input Text handle key up event

Description

Javascript DOM HTML Input Text handle key up event

View in separate window

<!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>



PreviousNext

Related