-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjsBasic.html
48 lines (43 loc) · 1.46 KB
/
jsBasic.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>자바스크립트연습</title>
</head>
<body>
<div onclick="output()">범인 판독기</div>
<input type="text" id="drink">
<input type="text" id="burger">
<!-- <input type="button" value="버튼이다" onclick="bb()"> -->
<!-- <input type="button" value="버튼이다" onclick="bb(document.getElementById('drink').value, document.getElementById('burger').value)"> -->
<input type="button" value="버튼이다" onclick="bb(getJuice.value, getMeal.value)">
<script>
var isMurderer = false;
isMurderer = true;
function murder(human) {
if(human == true) {
return "범인이다"
} else {
return "범인이 아니다"
}
}
function output() {
console.log( murder(isMurderer) );
}
function hamsu() {
return "안녕하세요!"
}
console.log(hamsu());
function bb() {
alert('경고다!');
}
var getJuice = document.getElementById('drink');
var getMeal = document.getElementById('burger');
function bb(juice, meal) {
alert("시원하고 달콤한 "+juice+"와 맛있는 "+meal);
}
</script>
</body>
</html>