JSFiddle - React, Tailwind, and code Playground
HTML
<div id="container" class="main-class"></div>
CSS
.main-class {
width: 500px;
height: 300px;
border: 1px solid black;
background-color: lightgray;
}
JavaScript
var objects = document.getElementsByClassName("main-class");
for (var obj of objects) {
console.log(obj);
}