Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<style>
.myStyle {
  background-color: coral;
  padding: 16px;
}
.anotherClass {
  text-align: center;
  font-size: 25px;
}
.thirdClass {
  text-transform: uppercase;
}
</style>
<body>
<h1>The Element Object</h1>
<h2>The classList Property</h2>
<div id="myDIV" class="myStyle anotherClass thirdClass">
<p>I am myDIV.</p> 
</div>
<p>The class names of "myDIV" are:</p>
<p id="demo"></p>
<script>
const list = document.getElementById("myDIV").classList;
document.getElementById("demo").innerHTML = list;
</script>
</body>
</html>