1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| <script>
function myFunction() {
var x = Math.floor((Math.random() * 10) + 1);
document.getElementById("val1").innerHTML = x;
var y = Math.floor((Math.random() * 10) + 1);
document.getElementById("val2").innerHTML = y;
var z =x +y
document.getElementById("val3").innerHTML = z;
}
</script>
<form method="POST">
<p id="val1"></p>
<p> + </p>
<p id="val2"></p>
<p> = </p>
<p id="val3"></p>
<p>résultat : <input type="text" size="20" name="T4"></p>
</form>
<script>
function {
var w="T4"
if (w == z) document.write("bon");
if (w != z) document.write("faux");
}
</script> |