JSFiddle - React, Tailwind, and code Playground

JavaScript

var intervalHandler;
var counter = 0;

$(document).ready(function() {
    $.ajaxSetup({ cache: false });
    intervalHandler = setInterval(function() {
        //$('#chatresults').load('includes/chat.php');
        console.log("Call to includes/chat.php");
        counter++;
        if (counter == 12) {
            clearInterval(intervalHandler);
        }
    }, 3000); 
});