1
Good evening, could someone assist me in a dubious.
Each time the person clicks on the BUTTON is called the function:
function cloneDivDescricaoProduto() {
var count = 0;
count++;
console.log(count);
var html_corpo = '<div class="form-group col-md-3"><label for="descricao">Qual seria o tamanho ?</label><input name="data[Tamanho]['+ count+'][descricao]" class="form-control" id="descricao" placeholder="Ex: Pequena, Media, Grande" type="text"></div>'+$(".criarCloneDescricao").html()+'</div>'
$(".criarCloneDescricao").html(html_corpo);
}
And in this function when being called I would like you to run the counter but always when you click it returns me 1 on the console.
What would be the expected result: By clicking the button call the function cloneDivDescricaoProduto()
and the counter is incrementing with each click and adding in the counter variable in the created div.