JSFiddle - React, Tailwind, and code Playground

HTML

<div>clikc me</div>

JavaScript

var stuff=['item', 'stuff', 'thingamajig'];
     var counter=-1;
  
     function goRight(){
       
         
         if(counter===13){
         counter=0;
         }else{
         counter++;
         }
       
   
     }
  

$("div").click(function(){
goRight();
    alert(counter);
});