const btnCart = document.querySelector('#cart-icon'); const cart = document.querySelector('.cart'); const btnClose = document.querySelector('#cart-close'); btnCart.addEventListener('click', () => { cart.classList.add('cart-active'); }); btnClose.addEventListener('click', () => { cart.classList.remove('cart-active'); }); document.addEventListener('DOMContentLoaded', () => { loadContent(); loadFood(); }); function loadFood() { // Any initialization related to food items can be placed here } function loadContent() { // Retrieve item list from localStorage itemList = JSON.parse(localStorage.getItem('cartItems')) || []; // Remove Food Items From Cart let btnRemove = document.querySelectorAll('.cart-remove'); btnRemove.forEach((btn) => { btn.addEventListener('click', removeItem); }); // Product Item Change Event let qtyElements = document.querySelectorAll('.ca...
Comments
Post a Comment