JSFiddle - React, Tailwind, and code Playground

HTML

<div class="slider1"></div>

CSS

.slider1 {
            width: 500px;
            height: 250px;
            margin: 0 auto;
            background-color:#aaf;
            # background-image: url(images/rectblue.png);
        }

JavaScript

var flashForever = function () {
    $(".slider1").fadeOut(2000).fadeIn(2000, flashForever);
};
$(document).ready(function () {
    flashForever();
});

//
//This runs the function 'runForever' one time only, how to run it every 4 sec? 
//the above commented out code does not work.