Spruch.js
var Anzahl = 10
Spruch = new Array(Anzahl);
Spruch[01] = "Text 1"
Spruch[02] = "Text 2"
Spruch[03] = "Text 3"
Spruch[04] = "Text 4"
Spruch[05] = "Text 5"
Spruch[06] = "Text 6"
Spruch[07] = "Text 7"
Spruch[08] = "Text 8"
Spruch[09] = "Text 9"
Spruch[10] = "Text 10"
var Zufall = Math.random()
var Zufall = Math.round((Anzahl-1) * Zufall) + 1
document.write(Spruch[Zufall])
HTML-Code
<script src="spruch.js"></script>
|