Edit This Code:
<!DOCTYPE html>
<html>
<head>
<style>
.mystyle {
    width: 500px;
    height: 50px;
    padding: 15px;
    border: 1px solid black;
}


.anotherClass {
    background-color: coral;
    color: white;
}


.thirdClass {
    text-transform: uppercase;
    text-align: center;
    font-size: 25px;
}

</style>
</head>
<body>

<p>Click the button to remove multiple classes from DIV.</p>

<button onclick="myFunction()">Try it</button>

<p><strong>Note:</strong> The classList property is not supported in Internet Explorer 9 and earlier versions.</p>

<div id="myDIV" class="mystyle anotherClass thirdClass">
I am a DIV element
</div>

<script>
function myFunction() {
    document.getElementById("myDIV").classList.remove("mystyle", "anotherClass", "thirdClass");
}
</script>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy