Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. <code html hello.html> <html> <head> <title>JavaScript Testseite</title> </head> <body> <h1>Mein Titel</h1> <button onclick="alert('hallo')"> Click mich!</button> </body> </html> </code> <code 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> </code> ffprog/ffprogjava2016/javascript.txt Last modified: 2016/08/19 17:05by Ivo Blöchliger