-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathob1.html
More file actions
43 lines (38 loc) · 1.17 KB
/
ob1.html
File metadata and controls
43 lines (38 loc) · 1.17 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
var tv = new Object();
tv.color = "white";
tv.price = "300000";
tv.info = function(){
document.write("tv 색상: " + this.color, "<br>");
document.write("tv 가격: " + this.price, "<br>");
}
/*var car = {
color : "black",
price : 500000,
info:function(){
document.write("car 색상: " + this.color, "<br>");
document.write("car 가격: " + this.price, "<br>");
}
}*/
var car = new Object();
car.color = "black";
car.price = "500000";
car.info = function(){
document.write("car 색상: " + this.color, "<br>");
document.write("car 가격: " + this.price, "<br>");
}
document.write("<h1>tv 객체 메서드 호출</h1>");
tv.info();
document.write("<h1>car 객체 메서드 호출</h1>");
car.info();
</script>
</body>
</html>