Answer the question
In order to leave comments, you need to log in
How to reset the color?
Tell me how to make it so that by clicking on .reset the colors are reset. I need to remove the additional class active on clicking reset
code example https://codepen.io/kiskiskit/pen/MWmypaB
Answer the question
In order to leave comments, you need to log in
const button = document.querySelector('.reset');
button.addEventListener('click', () => {
document.querySelectorAll('.active').forEach(element => element.classList.remove('active'));
});
<div class="reset">сброс цвета</div>
<button type="button" class="reset">сброс цвета</button>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question