cells js


#1

JS
My cells change colour in random order but sometimes, it selects itself again.
Does anyone know function in js about how to make the random cells not to select itself again.


#2

Start with each cell’s attribute selected=“false” Have the function give each cell a selected attribute set as true when it’s colour is set and use an if statement so when the condition within the function is true not to select itself again.


#3

Thanks. This was helpful.