Result Size: 625 x 534
x
 
<!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>单击该按钮可从 DIV 中删除多个类。</p>
<button onclick="myFunction()">试一试</button>
<p><strong>注意:</strong> Internet Explorer 9 及更早版本不支持 classList 属性。</p>
<div id="myDIV" class="mystyle anotherClass thirdClass">
我是一个 DIV 元素
</div>
<script>
function myFunction() {
  document.getElementById("myDIV").classList.remove("mystyle", "anotherClass", "thirdClass");
}
</script>
</body>
</html>