JSFiddle - React, Tailwind, and code Playground

by shuts13

HTML

<button class="control" onclick="update()">Control here</button>
<button class="control" onclick="update_2()">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');
  }
  function update_2() {
    const box = document.getElementById('box');
          if(box.classList.contains('rds')){
                            console.log('ECIS')
                box.classList.remove('rds');

          } 
  }