Perbarui JavaScript Kuantitas Keranjang

<script>
   var i = document.getElementById("carte").innerText;
      function addtocart() {
          i++;
      document.getElementById('carte').innerText = i;
    }
</script>
Naive Chief