-
Notifications
You must be signed in to change notification settings - Fork 0
/
Problme 1.html
47 lines (28 loc) · 1001 Bytes
/
Problme 1.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html>
<head>
<title>Multiplication Table</title>
<script type="text/javascript">
function generateMultiplicationTable() {
var number = prompt("Enter a number:");
number = parseInt(number);
var table = document.createElement("table");
for (var i = 1; i <= 10; i++) {
var row = document.createElement("tr");
var cell1 = document.createElement("td");
var cell2 = document.createElement("td");
cell1.textContent = number + " x " + i;
cell2.textContent = number * i;
row.appendChild(cell1);
row.appendChild(cell2);
table.appendChild(row);
}
document.body.appendChild(table);
}
</script>
</head>
<body>
<!-- Button to trigger the table generation -->
<button onclick="generateMultiplicationTable()">Generate Table</button>
</body>
</html>