I am trying to do a questionnaire that by clicking on the radio button, go to the next question, but I have a detail with the counter and print question 5 after 1, I thank you very much if you can help me with this question , thank you.
$(document).ready(function() {
//Muestra y oculta div's y botón
$("#div1").show();
$("#div2,#div3,#div4,#div5").hide();
$("#btnenvia").hide();
$("input[type=radio]").click(function(event) {
var valor = $(event.target).val();
var int = 1;
while (int <= 5) {
//Aquí comparo que el valor de **value** de los radiobutton sea diferente de 0
if (valor != 0) {
$("#div" + (int - 1)).hide();
$("#div" + (int)).show(1000);
}
//muestra boton de envia cuando el contador llegue a 5
int++;
if (int == 5) {
$("#btnenvia").show();
}
}
});
});