1
I am using bootstrap for a job, I have a class that repeats v'Many times, I would like to use getElementByClassName to take all the elements that has this class and use clasList.add to add one more class, changing the class of all objects.
<div class="conteiner">
<div class="row">
<div class="border"> <!-- div que quero adicionar a classe -->
<h1>Ola Mundo</h1>
</div>
</div>
</div>
<script>
const elemento = document.getElementByClassName('border');
var renovavel = false;
if (renovavel === true) {
elemento.classList.add('border-dark');
}
else {
elemento.classList.add('border-success');
}