JavaScript QuerySelector - по классу
<div class="box">
<h3>Heading inside the 1st box.</h3>
<p>This is a paragraph inside the <b>1st box</b>.</p>
</div>
<div class="box">
<h3>Heading inside the 2nd box.</h3>
<p>This is a paragraph inside the <b>2nd box</b>.</p>
</div>
<script>
// selecting element by class
let element = document.querySelector(".box");
element.style.background = "lightgreen";
</script>
Clumsy Caiman