Skip to content

Commit

Permalink
bug Fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
AtharvGaur05 committed Oct 23, 2024
1 parent 42a9eb6 commit 6d0c638
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -691,13 +691,27 @@ <h2>Feedback Form</h2>

<script>
let cartItemCount = 0;
// document.querySelectorAll('#cart-btn').addEventListener('click', function () {
// cartItemCount++; // Increment cart count
// document.getElementById('cart-count').textContent = cartItemCount; // Update cart count display
// alert('Item added to cart'); // Show alert
// });

// Function to handle Add to Cart button click
document.getElementById('cart-btn').addEventListener('click', function () {

const cartButtons = document.querySelectorAll('#cart-btn');
cartButtons.forEach(button => {
button.addEventListener('click', function () {
cartItemCount++; // Increment cart count
document.getElementById('cart-count').textContent = cartItemCount; // Update cart count display
alert('Item added to cart'); // Show alert
});
});
// Function to handle Add to Cart button click
// document.getElementById('cart-btn').addEventListener('click', function () {
// cartItemCount++; // Increment cart count
// document.getElementById('cart-count').textContent = cartItemCount; // Update cart count display
// alert('Item added to cart'); // Show alert
// });

</script>
<script src="https://unpkg.com/swiper/swiper-bundle.min.js"></script>
Expand Down

0 comments on commit 6d0c638

Please sign in to comment.