add onload file

This commit is contained in:
SpikeHD 2022-05-03 03:12:38 -07:00
parent 052e13f469
commit 19a176bdfd

7
scripts/onload.js Normal file
View File

@ -0,0 +1,7 @@
document.addEventListener("DOMContentLoaded", () => {
const sidebarItems = document.querySelector("#sidebar").children;
for (const item of sidebarItems) {
item.onclick = (e) => switchPage(e.target.dataset.value)
}
})