Так сделай хотя бы так же как у тебя уже сделано перелистывание вопросов.
const quizzes = document.querySelectorAll(".calc__fields");
quizzes.forEach((quiz) => {
const questions = quiz.querySelectorAll(".fields__field"),
btnsPrev = quiz.querySelectorAll(".btn-prev"),
btnsNext = quiz.querySelectorAll(".btn--icon-next"),
stages = quiz.querySelectorAll(".fields__stage");
console.log(stages)
// progress
// const progressCount = questions.length;
btnsNext.forEach((btnNext, btnNextIndex) => {
btnNext.addEventListener("click", (e) => {
e.preventDefault();
questions[btnNextIndex].classList.remove("_active");
questions[btnNextIndex + 1].classList.add("_active");
stages[btnNextIndex].classList.remove("_active");
stages[btnNextIndex + 1].classList.add("_active");
});
if (!questions[btnNextIndex].classList.contains("_range")) {
btnNext.disabled = true;
}
});
btnsPrev.forEach((btnPrev, btnPrevIndex) => {
btnPrev.addEventListener("click", (e) => {
e.preventDefault();
questions[btnPrevIndex + 1].classList.remove("_active");
questions[btnPrevIndex].classList.add("_active");
});
});
questions.forEach((question, questionIndex) => {
if (questionIndex === 0) {
question.classList.add("_active");
} else {
question.classList.remove("_active");
}
question.addEventListener("change", (e) => {
const target = e.target,
inputsChecked = question.querySelectorAll("input:checked");
if (
inputsChecked.length > 0 ||
target.classList.contains("range__input")
) {
btnsNext[questionIndex].disabled = false;
} else {
btnsNext[questionIndex].disabled = true;
}
});
});
});