-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
66 lines (54 loc) · 1.65 KB
/
Copy pathtest.html
File metadata and controls
66 lines (54 loc) · 1.65 KB
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
<!DOCTYPE html>
<html lang="kr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Javascript 연습</title>
</head>
<body>
<!-- <button type="button" onclick="changecolor()" >배경색 변경</button>
<div id="changecolor" width="30px" height="30px">배경색</div>
<input type="text" id="consoletext">
<button type="button" onclick="consoleprint()">click</button>
<script>
function consoleprint(){
let element1 = document.querySelector("#consoletext").value;
console.log(element1)
}
function changecolor(){
var element = document.querySelector("#changecolor");
element.style.backgroundColor = "gray";
element.style.color = "white";
}
</script>-->
<script>
test();
function test() {
console.log("Hello");
}
test();
// test2();
// let test2 = function() {console.log("Bye");}
// 화살표 함수 작성 방법
let test2 = () => {console.log("Bye");}
test2();
let sum = (a,b) => {return a+b;}
// console.log(sum(5,2));
// alert (sum(5,2));
// greeting(sayHello,"Javascript");
function sayHello() {return "Hello ";}
function greeting(helloMessage,name) {
console.log(helloMessage()+name);
}
greeting(sayHello,"Javascript");
const minus = function (a=1,b=2){ //익명함수
const num1 = 2;
const num2 = 1;
document.write(num1+num2);
document.write("<br />");
document.write(a+b);
};
minus(5,7);
</script>
</body>
</html>