@@ -159,63 +159,3 @@ main.appendChild(div);
159
159
160
160
161
161
162
- // let num = 0;
163
- // let boy = 0;
164
- // let girl = 0;
165
- // // Load data from localStorage on page load
166
- // window.onload = function() {
167
- // var savedData = localStorage.getItem("students");
168
- // if (savedData) {
169
- // var students = JSON.parse(savedData);
170
- // for (var i = 0; i < students.length; i++) {
171
- // addStudentToDOM(students[i]);
172
- // }
173
- // }
174
- // };
175
- // // localStorage.clear()
176
- // document.getElementById("add").addEventListener("click", () => {
177
- // const name = document.getElementById("name").value;
178
- // const email1 = document.getElementById("email1").value;
179
- // const gender = document.getElementById("gender").value;
180
-
181
- // const student = {
182
- // nameof: name,
183
- // email1of: email1,
184
- // genderof: gender
185
- // };
186
-
187
- // const students = JSON.parse(localStorage.getItem("students")) || [];
188
- // // console.log(students);
189
- // students.push(student);
190
- // localStorage.setItem("students", JSON.stringify(students));
191
-
192
- // addStudentToDOM(student);
193
- // // updateCounts(students);
194
- // });
195
- // // localStorage.clear()
196
- // function addStudentToDOM(student) {
197
- // console.log(student);
198
- // const main = document.getElementById("main");
199
- // const div = document.createElement("div");
200
-
201
- // div.innerHTML = `
202
- // <div class="col-12 d-flex flex-column student-entry">
203
- // <div class="d-flex col-12 flex-row justify-content-around align-content-end">
204
- // <div class="d-flex col-10 px-1 mt-3">
205
- // <p class="px-2 col-4">${student.nameof}</p>
206
- // <p class="px-2 col-5">${student.email1of}</p>
207
- // <p class="px-2 col-4">${student.genderof}</p>
208
- // </div>
209
- // <div class="d-flex col-2 flex-row justify-content-end align-content-end">
210
- // <button class="edit-btn">Edit</button>
211
- // <button class="remove-btn">Remove</button>
212
- // </div>
213
- // </div>
214
- // </div>
215
- // `;
216
- // main.appendChild(div);
217
-
218
- // div.querySelector('.edit-btn').addEventListener('click', () => editStudent(student, div));
219
- // div.querySelector('.remove-btn').addEventListener('click', () => removeStudent(student, div));
220
- // }
221
-
0 commit comments