Tip or pure JQuery , it becomes easier to understand logic. (In your example there was jQuery mixing with pure Javascript)
Below is your example working in Jquery.
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script><script>$(document).ready(function(){$("#nome").keypress(function(){
var valor = $("#nome").val();
$("#aqui").text(valor);
});
});
</script>
</head>
<body>
<input type="text" id="nome">
<div id="aqui"></div>
</body>
</html>
In pure javascript:
<html>
<head>
<script>
function peganome(valor) {
document.getElementById("aqui").innerHTML = valor;
}
</script>
</head>
<body>
<input type="text" id="nome" onkeyup="peganome(this.value);">
<div id="aqui"></div>
</body>
</html>
In AngularJS (without jquery or any other plugin)
<html ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js"></script></head><body><div><label>Nome:</label><inputtype="text" ng-model="nome">
<hr>
<h1>Olá {{nome}}!</h1>
</div>
</body>
</html>
NOTE: In AngularJS is the easiest basically is a ng-model="name" and
then to display is {{name}}, but use AngularJS only for
this is like having a Ferrari to just go to the bakery.