Limiting event execution and listening to events

0

I need to limit the number of times a button is clicked, below its code

    $(".add-produtos").on("click", function(){
    for(var z = 0; z < 17; z++) {
        var testar = produtoObj(i++); //produtoObj é o objeto que renderiza os proddutos na tela, se for necessario posta-lo me falem.
        testar.renderiza();
    };
});

And I also wanted to know how I can to load more products they have attached to them the function below

        function addCarrinho(){
        var total = 0;

        $("#circulo").html(total);

        $(".material-icons").on("click",function(){
            var soma = total++;
            console.log(soma);
            var somado = soma.toString();
            console.log(somado);
            $("#circulo").html(total);
        });
    }
    
asked by anonymous 25.04.2017 / 18:52

0 answers