Check out example codes for "javascript remove css class". It will help you in understanding the concepts better.

Code Example 1

//remove a css class from an element
document.getElementById("myElementID").classList.remove("class_name");

Code Example 2

const removeClass = (element, name) => {
    const pattern = new RegExp('(?:^|\\s)'+ name + '(?:\\s|$)', 'g');
    element.className = element.className.replace(pattern, "");
};

Code Example 3

function removeClass() {
  var element = document.getElementById("myDIV");

    element.classList.remove("mystyle");
}

Learn ReactJs, React Native from akashmittal.com