how to remove an class in javascript

JavaScript
//remove a css class from an element
document.getElementById("myElementID").classList.remove("class_name"); document.getElementsByClassName("legend").style.display="none";function removeClass() {
  var element = document.getElementById("myDIV");

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

Also in JavaScript: