I have this div, which is <div class='pergunta'>
, inside it I have <input type='text'> <select></select> <input type='checkbox'>
The question is that this entire div can be repeated if I click add new question, ie I can have 1 or N divs containing these same fields, I need to do a Javascript / jQuery script that takes the value of each field and stores it in an array, for example, I have two <div class'pergunta'>
with these fields, I need to add the values of each field in an array by example:
var array = [{titulo: , tipo: , requerido: }, {titulo: , tipo: , requerido: }]
That is, how do I add the values of these fields of each div to an array?