Skip to content
Advertisement

How to reset black colored grid to white by clicking reset button?

I am creating a etch-a-sketch game. Now, the grid cells change to black when i hover mouse. I want to turn every cell to white when i press reset button.I tried creating an event Listener to button and giving a function to change for background of cells.It didn’t work.

Thank you.

JavaScript

Advertisement

Answer

You could just set the grids innerHTML to an empty string.

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement