I want to add dynamically +1 to css selector each time function happens so it would select next question each time.
var questionCount = 2;
var previousQuestion = 1;
function start(){
document.getElementById("question" + questionCount).className = "question_box";
document.getElementById("question" + previousQuestion).className = "question_box disabled_gone";
$('#question' + previousQuestion).animate({height: '0', margin:'0',padding:'0'});
var questionCount = questionCount + 1;
var previousQuestion = previousQuestion + 1;
}
It works when I add first variables at the beginning of function but it will set variables to 2 and 1 once i run function again.
.className = "question_box" + questionCount ;