JSFiddle - React, Tailwind, and code Playground

by shuts13

HTML

<button class="control" onclick="update()">Control here</button>

    <div class="box" id="box">

    </div>

CSS

.box{
        width: 200px;
        height: 200px;
        background: red;
        transition: 1s;
    }
    .rds{
        border-radius: 50%;
    }
    .ok{
        border: 10px  dotted blue;
    }

JavaScript

function update() {
  const box = document.getElementById('box');

              box.classList.add('rds');
              box.classList.add('ok');

  setTimeout(()=> {
            if(box.classList.contains('rds')){
                            console.log('ECIS')
                box.classList.remove('rds');
            } 
  }, 1000)
  }