JSFiddle - React, Tailwind, and code Playground

by 3gwebtrain

HTML

<div id="myDiv" class="page-parent pop">
  Checking
</div>

CSS

.page-parent.pop{
  border:2px solid red;
}

.pop{
  border:2px solid blue;
}

JavaScript

function myfunction(){

	const body = document.getElementById('myDiv');

	body.classList.forEach(function (value) {
    //remove page-parent
    if (/^page.+/.test(value)) {
      body.classList.remove(value);
    }
  });
    
}

myfunction();