I’m trying to do a simple program to fill some divs and I need a reset button to be able to clear all divs filled with content, so the user could input on divs all over again. Here is my code:
// **reset function**:
const clearAll = document.getElementsByClassName("clear");
clearAll.addEventListener('click', clearCells);
function clearCells(){
for (let i = 0; i < cells.length; i++){
cells[1] = "green";
}
}
Sorry for the noob question, still trying to figure some things out.