I have a li that receives several values, they have the same class. I need to get these values and move to hidden fields to send via $ _POST to a PHP page. I've been able to get the data I need, but I need to pass this data one by one.
$(function() {
var x = [];
$('#selecao .active').each(function() {
x.push($(this).val());
});
$('.p').text(x);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script><divid="selecao">
<input type="text" class="active" value="Conteudo 1" />
<input type="text" class="active" value="Conteudo 2" />
<input type="text" class="active" value="Conteudo 3" />
<input type="text" class="active" value="Conteudo 4" />
<input type="text" class="active" value="Conteudo 5" />
<input type="text" class="active" value="Conteudo 6" />
<input type="text" class="active" value="Conteudo 7" />
<input type="text" class="active" value="Conteudo 8" />
<input type="text" class="active" value="Conteudo 9" />
<input type="text" class="active" value="Conteudo 10" />
<p class="p"></p>
</div>