Last active
November 23, 2020 03:19
-
-
Save Phongtlam/11588bb12aa31db5482c1de46ed6d336 to your computer and use it in GitHub Desktop.
recycleDOM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const recycleDOM = firstIndex => { | |
for (let i = 0; i < listSize; i++) { | |
const tile = document.querySelector("#cat-tile-" + i); | |
tile.firstElementChild.innerText = DB[i + firstIndex].title; | |
tile.lastChild.setAttribute("src", DB[i + firstIndex].imgSrc); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment