ffprog:ffprogjava2016:javascript

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

ffprog:ffprogjava2016:javascript [2016/08/19 16:31]
Ivo Blöchliger created
ffprog:ffprogjava2016:javascript [2016/08/19 17:05] (current)
Ivo Blöchliger
Line 10: Line 10:
 <button onclick="alert('hallo')"> <button onclick="alert('hallo')">
 Click mich!</button> 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> </body>
 </html> </html>
 </code> </code>
  • ffprog/ffprogjava2016/javascript.1471617100.txt.gz
  • Last modified: 2016/08/19 16:31
  • by Ivo Blöchliger