Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug Fixed #656

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading