diff --git a/js/index.js b/js/index.js index 67ee604..9931c91 100644 --- a/js/index.js +++ b/js/index.js @@ -15,6 +15,9 @@ if (localStorage.getItem('temp_date') !== null) { dateInput.value = formattedDate; } +let table = document.createElement("table"); +let thead = document.createElement("thead"); +let tbody = document.createElement("tbody"); generateTable(); getDateOfRecords(); @@ -22,10 +25,6 @@ getDateOfRecords(); setInterval(getDateOfRecords, 2000); function generateTable() { - let table = document.createElement("table"); - let thead = document.createElement("thead"); - let tbody = document.createElement("tbody"); - table.appendChild(thead); table.appendChild(tbody);