forked from gSchool/checkerboard-exercise
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
22 lines (21 loc) · 661 Bytes
/
Copy pathscript.js
File metadata and controls
22 lines (21 loc) · 661 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var container = document.createElement('div');
container.style.width = '700px';
container.style.height = '700px';
document.body.appendChild(container);
for (var i = 0; i < 81; i++) {
if(i % 2 === 0) {
var checker = document.createElement('div');
checker.style.backgroundColor = "black";
checker.style.float = 'left';
checker.style.width = '11.1%';
checker.style.height = '11.1%';
container.appendChild(checker);
} else {
var checker = document.createElement('div');
checker.style.backgroundColor = "red";
checker.style.float = 'left';
checker.style.width = '11.1%';
checker.style.height = '11.1%';
container.appendChild(checker);
}
}