Skip to content

Commit

Permalink
Added logic to clear the list
Browse files Browse the repository at this point in the history
  • Loading branch information
sejal-bansal committed Dec 4, 2023
1 parent 706dab5 commit 095aa23
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ document.getElementById("backToTopBtn").onclick = function() {
// Populate tables
function populateTable(tableId, data, linkPrefix) {
const table = document.getElementById(tableId);
// Clear existing rows
while (table.rows.length > 0) {
table.deleteRow(0);
}
data.forEach((item) => {
const row = table.insertRow();
row.setAttribute("data-aos", "fade-right");
Expand Down

0 comments on commit 095aa23

Please sign in to comment.