-
Notifications
You must be signed in to change notification settings - Fork 0
/
onetoten.html
121 lines (105 loc) · 3.12 KB
/
onetoten.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!DOCTYPE html>
<html lang="en">
<head>
<title>Iterative</title>
<style>
.main-container {
height: 500px;
width: 50%;
background-color: grey;
margin-left: 25%;
display: flex;
flex-direction: column;
}
.display {
height: 250px;
width: 100%;
background-color: bisque;
border-radius: 10px;
text-align: center;
font-size: 20px;
}
button {
height: 50px;
width: 80%;
background-color: greenyellow;
margin: 5px;
}
input {
height: 50px;
width: 80%;
background-color: yellow;
}
.center {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin: 10px;
}
/* .button:hover {
height: 200px;
width: 200px;
} */
</style>
<script>
// function displayText() {
// let x = document.getElementById("input").value;
// x = 1;
// while (x <= 20) {
// if (x % 2 == 1) {
// console.log("output =", x);
// }
// document.getElementById("display").innerHTML = x;
// x++;
// }
// }
// function displayText() {
// let x = document.getElementById("input").value;
// x = 1;
// while (x <= 20) {
// console.log("output =", x);
// document.getElementById("display").innerHTML = x;
// // x = x + 2; //type one
// x += 2; //type two
// // x++; //type three
// // x++;
// }
// }
// function displayText() {
// let x = document.getElementById("input").value;
// x = 3;
// let output;
// while (x <= 30) {
// console.log("output =", x);
// document.getElementById("display").innerHTML = x;
// x += 3;
// }
// }
function displayText() {
// let x = document.getElementById("input").value;
let num = prompt("what a table you want");
num = Number(num);
let x = 1;
while (x <= 10) {
console.log("output =", x * num);
document.getElementById("display").innerHTML = x;
x++;
}
}
function clearText() {
document.getElementById("display").innerHTML = "";
}
</script>
</head>
<body>
<div class="main-container">
<div class="display" id="display"></div>
<div class="center">
<input class="button" type="number" id="input" value="" />
<button class="button" id="text-display" onmouseenter="displayText()" onmouseleave="clearText()">Click
here</button>
</div>
</div>
</body>
</html>