<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World w JavaScript</title>
</head>
<body>
<h2>Hello World w JavaScript</h2>
<input type="text" id="myText" onkeyup="update()" onkeydown="update()">
<span id="myResult"></span>
<script>
function update() {
var text = document.getElementById("myText").value;
document.getElementById("myResult").innerHTML = text;
}
</script>
</body>
</html>