JSFiddle - React, Tailwind, and code Playground

by s4ty

HTML

<select id="font-size"></select>
<div id="text">
    Guten Morgen 

da ich kein Javascriptexperte bin und mir hier im Forum schon sehr oft geholfen wurde, denke ich dass jemand auch dieses mal eine Lösung hat 

Ich suche ein Script, das 6 Zahlen ausgibt, die ich selbst bestimmen und die Schriftgröße verändern kann.

Bsp: 1. Zahl = 5
2. Zahl = 9
3. Zahl = 2 
4. Zahl = 7
5. Zahl = 1
6. Zahl = 8

Die Zahlen sollen alle 3 Sekunden wechseln. Danach soll eine Box erscheinen, wo man die Zahlen eingibt, auf ok klickt (ohne Überprüfung) und zur nächsten Seite weitergeleitet wird.

Wäre toll, wenn mir jemand weiterhelfen kann.

Besten Dank und freundliche Grüße 

Sascha
</div>

JavaScript

$(function () {
    function arrayShuffle(){
      var tmp, rand;
      for(var i =0; i < this.length; i++){
        rand = Math.floor(Math.random() * this.length);
        tmp = this[i]; 
        this[i] = this[rand]; 
        this[rand] =tmp;
      }
    }
    
    Array.prototype.shuffle =arrayShuffle;
    
    
    
    var zahlen = new Array(10, 15, 20, 25, 30, 35);
    zahlen.shuffle();
    
    var fontSize = $('#font-size');
    $.each(zahlen, function (i,v) {
        fontSize.append($('<option>').html(v))
    });


    $('#font-size').change(function () {
        var size = $(this).find('option:selected').val();
        console.log(size);
        $('#text').css({fontSize: size+"px"});
    })            
})