Good note.
I have a problem in the logic of how to proceed between a set of questions and answers. I have the code below consisting of inputs with the types text and radio. I want to retrieve the information of these elements in the order they are presented. they present in the sequence question and answer. When the user finishes asking the questions and the answer I want the information to be allocated in a vector where the questions remained in indece odd and the answers in indece par (Recipe 1 as the first indece of the vector) WHEREAS THE DATA OF THE DOCUMENT OR THE DATA OF THE FIRST QUESTION ARE IN THE INDECE 1 THE DATA OF THE ANSWER OF QUESTION 1 ARE IN THE INDECE 2 DATA OF QUESTION 2 IT IS IN INDECE 2 AND ITS RESPONSE IS IN INDECE 3. (Values of the selected radios )
<input type="text" class="pergunta">
<div><input type="radio" class="resposta" name="grupo1"
value="num1">numero 1</div>
<div><input type="radio" class="resposta" name="grupo1"
value="num2">nunero 2</div>
<div><input type="radio" class="resposta" name="grupo1"
value="num3">numero 3</div>
<input type="text" class="pergunta">
<input type="text" class="resposta">
<input type="text" class="pergunta">
<div><input type="radio" class="resposta" name="grupo2"
value="num1">numero 1</div>
<div><input type="radio" class="resposta" name="grupo2"
value="num2">nunero 2</div>
<div><input type="radio" class="resposta" name="grupo2"
value="num3">numero 3</div>
<input type="button" value='botao'id="botao">
I am using the each function to get the data, but it takes the data of a type first ex text and then picks the radios