How to make so that with each click on a button, the number in another block is changed by one (+1)?

$('.add-tovar').click(function() { total_items = parseInt($("#tovar")) + 1; }) 
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <!-- корзина, вот надо чтобы в ней изменялся span на +1 --> <div class="bassket"> <p> Товаров:<span id="tovar">0</span> Цена: <span id="cena">0</span> </p> <i class="fas fa-shopping-basket"></i> </div> 

    1 answer 1

     $('.add-tovar').click(function () { $("#tovar").text(parseInt($("#tovar").text()) + 1); }) 
    • God grant you health - ilyaaa521
    • one
      @ ilyaaa521 God of health will give, and only you can mark the answer as accepted - the up arrow to the left. - 0xdb