I have been able to create the grid.
But when I try to change the background color of the grid when there’s an event of mouseover, only the first column gets affected.
Here’s my the link to my work: Etch-a-Sketch
I have been able to create the grid.
But when I try to change the background color of the grid when there’s an event of mouseover, only the first column gets affected.
Here’s my the link to my work: Etch-a-Sketch
Not sure what the ‘desired result’ is. As you’re passing in createDiv(100)
, are you asking for a 100x100 grid, or a 10x10?
If you’re expecting createDiv(100)
to create a grid 100 units to a side, then your JS is off.
If you’re using createDiv(100)
to create 100 grid cells, and you want them to automatically become a grid, then you are going to need to do a little funky CSS.
Both options are feasible, but either one goes in a totally different direction, so which are you looking at?
I was actually testing the code with createDiv(100)
which only creates just 100 divs but I want it to create a grid of 100 rows and 100 columns.