hello.html
<html>
<head>
  <title>JavaScript Testseite</title>
</head>
<body>
 
<h1>Mein Titel</h1>
 
<button onclick="alert('hallo')">
Click mich!</button>
 
</body>
</html>
rechner.html
<html>
<head>
  <title>JavaScript Testseite</title>
</head>
<body onload="neueRechnung()">
 
<script>
function neueRechnung() {
   var a = Math.floor(Math.random()*20);
   var b = Math.floor(Math.random()*20);
   richtig = a+b;
   var span = document.getElementById('rechnung');
   span.innerHTML = a+" + "+b+" = ?";
}
 
function hello() {
   var z = document.getElementById('zahl').value;
   if (z==richtig) {
 
   } else {
 
   }
   var span = document.getElementById('resultat');
   span.innerHTML = 'Resultat = '+r1;
   span.style.color="red";
}  
</script>
 
<h1>Mein Titel</h1>
 
<span id="rechnung"></span><br>
Ihr Resultat: <input id="zahl" />
<br>
<button onclick="hello()">
Click mich!</button>
 
<span id="resultat"></span>
 
</body>
</html>