JSFiddle - React, Tailwind, and code Playground

by Vikrant Khuspe

HTML

<span id='changeText'>Fysioterapeut</span>

JavaScript

$( document ).ready(function() {
    setInterval(change, 3000);
});
    var counter = 0;
    function change() {
    var text = ["Fysioterapeut", "Kiropraktor", "Praktiserende læge"];
    var elem = document.getElementById("changeText");
     elem.innerHTML = text[counter];
        counter++;
        if(counter >= text.length) { counter = 0; }
    }