-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathall.js
More file actions
24 lines (22 loc) · 782 Bytes
/
all.js
File metadata and controls
24 lines (22 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var wrap = document.querySelector('.wrap');
function createChart() {
for (let i = 2; i < 10; i++) {
const box = document.createElement('div');
box.setAttribute('class', 'box');
wrap.appendChild(box);
const chart = document.createElement('ul');
chart.setAttribute('class', 'chart');
box.appendChild(chart);
const title = document.createElement('li');
title.textContent = i;
title.setAttribute('class', 'chart_title');
chart.appendChild(title);
for (let j = 1; j < 10; j++) {
const answer = i * j;
const list = document.createElement('li');
list.textContent = `${i}x${j}=${answer}`;
chart.appendChild(list);
};
};
}
createChart();