forked from ut-code/gitpod-web-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
47 lines (38 loc) · 963 Bytes
/
script.js
File metadata and controls
47 lines (38 loc) · 963 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
let myGreatName;
myGreatName = "Becky Jones";
document.write(myGreatName);
let price = 100;
price = price / 2;
document.write(price);
let age = 18;
if (age < 18) {
document.write("選挙権はありません");
} else if (age >= 18 && age < 25) {
document.write("投票に行けます");
} else {
document.write("衆議院に立候補できます");
}
function greet(greetingType, myName) {
document.write("Good " + greetingType + ", " + myName + "!");
}
greet("morning", "佐藤");
function calculateCost(monthlyBandwidth) {
if (monthlyBandwidth < 5.0) {
return monthlyBandwidth * 600;
} else {
return 3000;
}
}
document.write(calculateCost(3.5));
*/
/*
let element = document.getElementById("greeting");
element.textContent = "Hello DOM";
element.style.backgroundColor = "red";
*/
function clicked() {
document.write("Hello World");
}
let greetButton = document.getElementById("greet-button");
greetButton.onclick = clicked;