()
| 4 | |
| 5 | |
| 6 | function getRandomColor(){ |
| 7 | let val1 = Math.ceil(0 + Math.random()* 255); |
| 8 | let val2 = Math.ceil(0 + Math.random()* 255); |
| 9 | let val3 = Math.ceil(0 + Math.random()* 255); |
| 10 | return `rgb(${val1}, ${val2}, ${val3})` |
| 11 | } |
| 12 | Array.from(boxes).forEach(e=>{ |
| 13 | e.style.backgroundColor = getRandomColor() |
| 14 | e.style.color = getRandomColor() |