Skip to content

Commit dfb6052

Browse files
committed
checkbox logic
1 parent d771cd0 commit dfb6052

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

15 - LocalStorage/index-START-y.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ <h2>LOCAL TAPAS</h2>
2828
<script>
2929
const addItems = document.querySelector('.add-items');
3030
const itemsList = document.querySelector('.plates');
31-
const items = [];
31+
const items = JSON.parse(localStorage.getItem('items')) || [];
3232

3333
function addItem(e){
3434
e.preventDefault();
@@ -58,8 +58,15 @@ <h2>LOCAL TAPAS</h2>
5858
}).join('');
5959
}
6060

61+
function toggleDone(e){
62+
63+
}
6164

6265
addItems.addEventListener('submit', addItem);
66+
populateList(items, itemsList);
67+
68+
const checkboxes = document.querySelectorAll('input');
69+
checkboxes.forEach(input =>input.addEventListener('click', () => alert('hi')));
6370
</script>
6471

6572

0 commit comments

Comments
 (0)