Skip to content

Commit ead518c

Browse files
committed
🗑 - Add Clear Cart button
1 parent 25b1189 commit ead518c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</thead>
3939
<tbody></tbody>
4040
</table>
41-
<a href="#" id="empty-cart" class="button u-full-width">Vider
41+
<a href="#" id="empty-cart" class="empty-cart button u-full-width">Vider
4242
le panier</a>
4343
</div>
4444
</li>

js/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ function productItemsInCart(product, cart) {
131131
document.addEventListener('click', function (e) {
132132
if(e.target.classList.contains('add-to-cart')){
133133
addToCart(e.target.dataset.id); // Add to cart
134-
} else if(e.target.classList.contains('#empty-cart')) {
134+
} else if(e.target.classList.contains('empty-cart')) {
135135
localStorage.clear();
136136
document.querySelector('#cart-table tbody').innerHTML = "";
137137
} else if(e.target.classList.contains('fa-trash')) {

0 commit comments

Comments
 (0)